1
我试图用http头下载文件,但它不会完全下载。上传的文件size is 1 MB
和文件仅用我的代码336 byte
大小下载。HTTP头文件没有完全下载
我用下面的代码
$attachment_location= "filename";
$filePath= "$siteURL/foldername/filename";
$file_content = file_get_contents($filePath);
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$attachment_location\"");
echo $file_content;
该问题可能会回答你的问题https://stackoverflow.com/questions/386845/http-headers-for-file-downloads –