我有一个代码:
$name = "jeffrey.epub"; //for naming only
$file = "test/cover/cabang.epub"; //the real file to be downloaded
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.basename($name).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
但是在获得下载文件后,它出现了corrupted.i也将header('Content-Type: application/octet-stream');
更改为header('Content-Type: application/epub+zip');
但是它仍然已损坏,我想知道该文件被破坏的问题是什么< / p>