下载 .ai(adobe illustrator)文件 - 文件似乎已损坏
我有这个代码:
$bmpblob = file_get_contents($image);
header('Content-type: application/postscript');
header('Content-Disposition: attachment; filename="'.$id1.'.ai"');
echo $bmpblob;
但是当我下载这个文件时它已损坏。
我有类似的 .psd 文件代码,并且它正在工作:
$bmpblob = file_get_contents($image);
header('Content-type: image/psd');
header('Content-Disposition: attachment; filename="'.$id1.'.psd"');
echo $bmpblob;
我做错了什么?
I have this code:
$bmpblob = file_get_contents($image);
header('Content-type: application/postscript');
header('Content-Disposition: attachment; filename="'.$id1.'.ai"');
echo $bmpblob;
But when I download this file it's corrupted.
I have similar code for .psd files and it's working:
$bmpblob = file_get_contents($image);
header('Content-type: image/psd');
header('Content-Disposition: attachment; filename="'.$id1.'.psd"');
echo $bmpblob;
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我知道是怎么回事了。
当我打开在 Notepad++ 中下载的文件时,我注意到在文件末尾有:
因此文件已损坏。
但奇怪的是,.psd 文件的末尾是相同的,而且它们工作得很好:)
Ok, I found out what was the matter.
When I opened the file I download in Notepad++, I noticed, that in the end of the file I have:
So thus file was corrupted.
It strange, though, that .psd files had the same on the end and they worked perfectly :)