IIS 8.5 truncating file download

42 views
Skip to first unread message

hofar...@houseoffusion.com

unread,
Nov 9, 2014, 12:18:21 PM11/9/14
to ColdFusion Technical Talk

I am doing a server migration to IIS 8.5 and CF10 and having some issues delivering PDF files. I tried the code using the built in web server and it works without issue so I know the issue is in IIS somewhere. Basically what happens is it truncates the PDF file to the first 749 bytes. I have disabled the compression in IIS and still having issues.

<cfheader name="Content-Disposition" value="attachment;filename=MyPDF.pdf">
<cfcontent type="application/pdf" reset="yes" file="C:\inetpub\wwwroot\MyPDF" deleteFile="no">

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359579

hofar...@houseoffusion.com

unread,
Nov 9, 2014, 5:07:31 PM11/9/14
to ColdFusion Technical Talk

I would check the response headers for any hints, you may be getting a
mismatch with the expected content length.
Also, take a look at this setting in IIS and see if disabling it helps:
http://screencast.com/t/H03SiWuabri
If so, then you may just need to tweak the value.
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359580

hofar...@houseoffusion.com

unread,
Nov 9, 2014, 9:44:43 PM11/9/14
to ColdFusion Technical Talk

Yes there is a mismatch on the Content-Length variable. I tried setting it manually without any luck.

<cfset variables.temporaryFilePath = "C:\inetpub\wwwroot\MyPDF.pdf">
<cfheader name="Content-Length" value="#getFileInfo(variables.temporaryFilePath).size#"/>
<cfheader name="X-Content-Length" value="#getFileInfo(variables.temporaryFilePath).size#"/>

There are no entries in the Output Caching at the global or website level

>I would check the response headers for any hints, you may be getting a
>mismatch with the expected content length.
>Also, take a look at this setting in IIS and see if disabling it helps:
>http://screencast.com/t/H03SiWuabri
>If so, then you may just need to tweak the value.
>
>
>
>>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359584

hofar...@houseoffusion.com

unread,
Nov 9, 2014, 10:39:29 PM11/9/14
to ColdFusion Technical Talk

Try this instead of that.

<cfcontent
type = "text/html"
file = "C:\CFusion\wwwroot\myapps\cfcontent_message.htm"
deleteFile = "No">


Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/
Google+: http://plus.google.com/113032480415921517411
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359585

hofar...@houseoffusion.com

unread,
Nov 10, 2014, 4:06:42 AM11/10/14
to ColdFusion Technical Talk

Try setting the maxAllowedContentLength in your web.config
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359586
Reply all
Reply to author
Forward
0 new messages