0
4

2 回答 2

0

尝试在开始使用ob_end_clean设置标头之前立即刷新输出缓冲区,然后在回显后立即退出。查看PHP 书籍中关于 Output Control 的部分

另一种可能性是您在尝试回显数据时内存不足,并且错误被所有前面的二进制文件混淆了。尝试将二进制文件分成更小的块(substr二进制安全),遍历它们并将它们返回到输出缓冲区。

于 2013-08-30T10:51:46.733 回答
0

use BLOB in MySQL to prevent that the data is changed due to the encoding (there might be encoding issues which produce your errors, saving as BLOB is binary safe)

related to Binary Data in MySQL

it may be better to store a link as file reference in the database instead of saving the actual content of the file and retrieve the files using file_get_contents and other related functions to get the mimetype (or finfo) ...

take a look at Trying to download Blob via PHP / MySQL and http://www.sitepoint.com/forums/showthread.php?693871-Problem-using-PHP-to-pull-binary-files-from-a-BLOB-field-in-MYSQL

于 2013-08-29T21:15:34.543 回答