2016-07-27 4 views
-2

私はそれが私は、ファイルを解凍しないのでfaulltを使用してファイルをダウンロードされるファイルPHPヘッダーのContent-Lengthの使用は何ですか?

$full_path_file=ctrl_options::GetSystemOption('sentora_root') . "etc/tmp/". basename($backup); 

$file_for_user=basename($backup); 
header('Content-Description: File Transfer'); 
header("Content-type: application/octet-stream");  
header('Content-Disposition: attachment; filename="'.$file_for_user.'"'); 
header('Expires: 0'); 
header('Cache-Control: must-revalidate'); 
header('Pragma: public'); 
header('Content-Length: ' . filesize($full_path_file)); 
readfile($full_path_file); 

をダウンロードするために以下のコードを使用しています。 私はそれがうまく働いて、以下の行

header('Content-Length: ' . filesize($full_path_file)); 

コメントます。ヘッダー( 'Content-Length:'。filesize($ full_path_file));のクリアカット機能を教えてください;

+0

"php header"の "http header" – jmattheis

+0

Ok。ありがとう@jmattheis。 httpヘッダー( 'Content-Length:'。filesize($ full_path_file))の使用を教えてください。 ? –

答えて

0

私は、 ファイルをダウンロードする前に、ブラウザはダウンロードしているファイルのサイズを知っている必要があります。ブラウザ/ダウンロードマネージャは、ダウンロードしたデータの一部を管理することができます。

関連する問題