简体   繁体   English

下载PDF文件会出现“网络错误”

[英]Downloading a PDF file gives a “Network Error”

Im in a TYPO3 system and I have an extension where I built a PDF file using fpdf. 我在TYPO3系统中,我有一个扩展,我用fpdf构建了一个PDF文件。

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". 当我提交带有数据的表单时,文件被下载(大约3MB文件),但是当下载达到100%时,它会给我一个“未知的网络错误”。 (Thats the message in Chrome) (这是Chrome中的消息)

This is my extension: http://pastebin.com/8GQCcKWj 这是我的扩展: http//pastebin.com/8GQCcKWj

What am I missing? 我错过了什么?

Simple solution: Don't do a 简单的解决方案:不要做

return $pdf->Output('medienpass.pdf', 'D');

in your getPdf() function because the output will be wrapped up in a lot of html code. 在你的getPdf()函数中,因为输出将被包含在很多html代码中。

Instead return only your pdf to the client: 而只返回您的pdf到客户端:

die($pdf->Output('medienpass.pdf', 'D'));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM