こんにちは、私はforce_download関数に関する1つの問題があります。私はウェブサイトにアップロードフォームを持っています。この関数を使用してアップロードしたデータをダウンロードしています。codeigniterの画像とpdfファイルでforce_downloadを実行していません
public function download($file)
{
force_download('./uploads/'.$file, NULL);
}
しかし、pdf、png、jpgファイルは、ダウンロードする必要がない場合には直接表示できますが、この機能を使用するとすべてのファイルがダウンロードできます。
アップロードフォルダーへの直接リンクを使用しようとしましたが、ログインユーザーが何かをダウンロードできるだけのアクセスを拒否する.htaccessファイルがあるため、可能です。
まず、ファイルの種類を確認する必要があります。それに応じて行動してください。コンテンツの処理方法を[このコード](http://stackoverflow.com/questions/38651094/access-file-outside-public-html-using-codeigniter-3-x/38658618#38658618)にチェックしてください。 – Tpojka
ありがとう、この作品は今私は直接それをダウンロードせずにしたい場合は、png、jpg、mp4に似た何かがpdfファイルを直接見ることができます...?ブラウザに直接開くことができる他のファイルタイプがあります。 – htmlpower