Copy link to clipboard
Copied
I have a website that worked fine with Coldfusion 10 and now I have updated to Coldfusion 11 and this code doesn't work:
<cfheader name="content-disposition" value="inline; filename=#vPublicFile#" />
<cfcontent type="application/pdf" file="#DownloadFolder##qryDownload.fileNameOnserver#" deleteFile="no" />
If I type in the URL directly to the PDF file it loads fine, but if I try to get it through this code then I get the message "failed to load PDF document". Even if I change the code to allow me to save the file, I get a saved file but it won't open in acrobat.
I know the code is working code, I tried it with Coldfusion 10 again just to make sure. Something about 11 is stopping it from working. Any ideas?
Copy link to clipboard
Copied
Have you tried different versions of the browser? I am finding a similar issue with ColdFusion 11 running in IE8..It works fine in FireFox and in IE10...
Copy link to clipboard
Copied
We are also facing problems after updating to CF10 Update 14 with this issue. We do notice that the behavior is different based on the browser used on the client side. Photo uploads no longer work in Mango Blog 1.7 when using IE, but do work when using Google Chrome.
Copy link to clipboard
Copied
Please vote up this bug:
Bug#3850990 - coldfusion 10 update 14. failed to load pdf document
Copy link to clipboard
Copied
And provide any details so that they can "VERIFY" it.
Copy link to clipboard
Copied
Is this still a thing? I'm experiencing this on CF11 presently.
I can't make
<cfcontent file ="#literalFilePath#" type ="image/jpeg" />
work through a redirect, though it works fine when loaded without it.
I'm working with images on this task. Will upgrading to the latest isapi_redirect.dll do the trick?
Thanks for your feedback!
Copy link to clipboard
Copied
Is anyone still experiencing this issue or have a good fix for it?
Currently on Coldfusion 11 Update 7 and IIS 8 and experiencing the exact behavior as noted above. Having to implement a workaround for this would cost us quite a bit of development time.
Thank you!
Copy link to clipboard
Copied
Sorry didn't seem to get notified of this message and just saw it. I am using Coldfusion 11 Update 7 and I still see the problem.
Copy link to clipboard
Copied
Still having this issue on ColdFusion 11 update 7 with latest connector installed when using iis rewrites with query string parameters. Anyone else still having the problem? Know of a quick fix other than writing a workaround? IIS connector settings? Thanks!
Copy link to clipboard
Copied
I recently ran into this same issue on ColdFusion 2016 (update 3) on Windows 10 and also on Windows Server 2012.
I can confirm based on what previous posters have said that when IIS rewrite is enabled the wrong HTTP response headers are sent to the browser. Additionally, the wrong content length is also sent. I believe that this is a connector issue and not IIS.
Here is an example of the proper response header when accessing a file (e.g. /test/file.cfm?filesID=1)
Cache-Control:no-cache, no-store, must-revalidate, max-age=0
Content-Disposition:attachment; filename="Wag_Cameras_Administration_Documentation_10.pdf"
Content-Length:207349
Content-Type:application/unknown;charset=UTF-8
Date:Fri, 18 Nov 2016 01:16:02 GMT
Expires:Thu, 01 Jan 1970 00:00:00 GMT
Pragma:no-cache
Server:Microsoft-IIS/10.0
X-Powered-By:ASP.NET
Here's an example of the invalid response header when accessing a file via IIS rewrite (e.g. /test/file/1/)
Cache-Control:no-cache, no-store, must-revalidate, max-age=0
Connection:close
Content-Disposition:attachment; filename="Wag_Cameras_Administration_Documentation_10.pdf"
Content-Length:1284
Content-Type:application/unknown;charset=UTF-8
Date:Fri, 18 Nov 2016 01:16:39 GMT
Expires:Thu, 01 Jan 1970 00:00:00 GMT
Pragma:no-cache
Server:Microsoft-IIS/10.0
X-Powered-By:ASP.NET
There are two things wrong with the response header. The first is that "Connection: close" has been added as well as an incorrect content-length which is why the file you wind up downloading is a corrupted (incomplete) version of the PDF you wanted.
I created a bug in the adobe bugbase here: Bug#4197947 - <cfcontent> fails to serve PDF files when using IIS rewrite
Please vote for it. Unfortunately since this issue is difficult to replicate if anyone can add their own replication code to the bug I'm sure it would be a big help to the dev team.