下载PDF文件会显示“网络错误". [英] Downloading a PDF file gives a "Network Error"
本文介绍了下载PDF文件会显示“网络错误".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在TYPO3系统中,我有一个扩展名,我在其中使用fpdf构建了PDF文件.
Im in a TYPO3 system and I have an extension where I built a PDF file using fpdf.
当我提交带有数据的表格时,文件被下载(大约3MB),但是当下载达到100%时,出现未知网络错误".(这就是Chrome中的消息)
When I submit the form with the data, the file is downloaded (around 3MB file) but when the download reaches 100%, it gives me a "Unknown Network Error". (Thats the message in Chrome)
这是我的扩展名: http://pastebin.com/8GQCcKWj
我想念什么?
推荐答案
简单的解决方案:不要做
Simple solution: Don't do a
return $pdf->Output('medienpass.pdf', 'D');
在您的getPdf()函数中,因为输出将被包装在许多html代码中.
in your getPdf() function because the output will be wrapped up in a lot of html code.
相反,仅将pdf返回给客户:
Instead return only your pdf to the client:
die($pdf->Output('medienpass.pdf', 'D'));
这篇关于下载PDF文件会显示“网络错误".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文