誤って解決させてしまったので再投稿しました。
Codeigniter2系を利用
マニュアルにそって、サーバー内のファイルを取り込み、出力しているのですがテキスト形式は普通にダウンロード開始するのですが、それ以外(バイナリ?)はダウンロードできず、ブラウザにファイル内容が表示されてしまします。
php
1$this->load->helper('file','download'); 2$this->load->library('upload'); 3$file = $url. $file; 4$data = readfile($file); 5force_download($file, $data);
とか
php
1$this->load->helper('file'); 2$this->load->library('upload'); 3$file = $url. $file; 4$data = readfile($file); 5$mime = get_mime_by_extension($file); 6$this->output 7 ->set_content_type($mime) 8 ->set_header('Content-Disposition: attachment; filename="'.basename($file).'"') 9 ->set_output($data);
みたいなことをやっても、こんな結果になってしまいます。
どのようにダウンロードさせたらよいでしょうか?
どなたかすごい方、よろしくご指導お願いします。
ーーーーーーーーーーーーーーーー
追記
ご依頼がありました
$file と $mime のダンプです
string(25) "./uploads/temp/150909.pdf"
string(15) "application/pdf"
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。