Hi !
We are serving some pdfs, in normal connection HTTP all runs perfect, but when the connection is secured, HTTPS, our friend IE doesn't want to download the file.
This problems only occurs in windows and with IE, with Opera, Mozilla, ... all works as expected.
After making a google search, the result is awsome, but in resume ...
Problem:
----------------------
When opening a PDF over SSL running on IIS 5.1 (Windows XP Professional, W2K Windows 2000, or Windows Server 2003), you may receive the following problem with Internet Explorer.
First, instead of opening the PDF in Acrobat Reader, IE asks you, "Do you want to open or save this file?". If you click "Open", then you receive the error, "Internet Explorer cannot download file.pdf from servername. Internet Explorer was not able to open this Internet site. The requested site is unavailable or cannot be found. Please try again later."
If you right-click on the link to the PDF, and select "Save", you receive the following error: "Internet Explorer cannot download file.pdf from servername. The file could not be written to the cache."
Cause:
----------------------------------
This problem occurs because the PDF returned by the web server contains HTTP headers to disable caching. Specifically, the header is the no-cache pragma. In VBScript ASP, the code lines that can cause this error are:
Response.AddHeader "pragma","no-cache"
or
Response.CacheControl = "no-cache"
Solution: ------------------ Remove the above headers for disabling caching.
So, after reading againg the Active4D manual, I think I can do it pretty easy, but ...
This is the response from the web server, with the file:
192.168.000.154.08080-192.168.000.004.03066: HTTP/1.0 200 OK Server: 4D_WebStar_D/7.5 Cache-Control: no-cache Pragma: no-cache Expires: Wed, 23 Feb 2005 15:39:47 GMT Content-Disposition: attachment; filename=RE001004.pdf Content-Type: application/octet-stream Date: Wed, 23 Feb 2005 15:39:47 GMT Last-Modified: Wed, 23 Feb 2005 15:39:47 GMT Content-Type: application/octet-stream Content-Length: 51756
For what I read, I think just removing the Cache-Control: no-cache and Pragma: no-cache should work, but ...
Here is the Active4D code ...
...
set response header("Content-Disposition"; "attachment; filename=" + $docFileName)
delete response header("Pragma")
delete response header("Cache-Control")set content type("application/octet-stream")write blob($blob_file; "application/octet-stream")
...
This doesn't work ...
I read or tried to read the RFC 2616, section 14.9, but ...
Are the response header names wrong ?
This should work ?
Thanks again for your help!
Regards,
Raimon Fernandez Barcelona, Spain
_______________________________________________ Active4D-dev mailing list [email protected] http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/
