epub在成功下载后损坏

时间:2015-12-23 05:45:30

标签: php download epub corrupt

我有一个代码:

$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>

0 个答案:

没有答案