• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1008
  • Last Modified:

PDF doesn't show in ie over https

I generate PDFs using Fop. All PDF docs are displyed over HTTP. When i switch it to HTTPS,  IE gives the following error:

"Internet Explorer cannot download ... xxxx from www.xxxxxxxx.com.

Internet Explorer was not able to open this internet site. The requested site is either unavailable or cannot be found. Please try again later."

(xxxx is the url)

I'm using IE version 6.0 with SP2, while using firefox doesn't get the above error.
0
syyung6
Asked:
syyung6
1 Solution
 
RedKelvinCommented:
0
 
syyung6Author Commented:
Thanks. That means i have to unset no-cache in the header....
but as it is a dynamic content, we are resistant to doing so....
0
 
Asta CuCommented:
Have you tried adding the problem link to IE?  Likely firewall/pop up blocker issues.  When you see this problem, do you see the yellow Information Bar on top?

IE - tools - internet options - privacy - pop up blocker - settings - paste the URL there...

If trusted URL, also use the Security tab to paste the link into your trusted zone, close IE after changes, and reopen to test.

Description of the Internet Explorer Information Bar in Windows XP SP2
Describes the new Internet Explorer Information Bar feature that is included in Windows XP SP2.
http://support.microsoft.com/default.aspx?scid=kb;en-us;843017
Windows XP Service Pack 2: Use the Internet Explorer Information Bar
Learn to use the Internte Explorer Information Bar in Windows XP SP2.
http://www.microsoft.com/windowsxp/using/web/sp2_infobar.mspx
How to Use the Explorer Bar in Internet Explorer
This article describes how to use the Explorer bar in Internet Explorer. The following topics are discussed: Enabling and disabling the Explorer barUsing the Explorer barResizing the Explorer bar The following Explorer bars are available in...
http://support.microsoft.com/default.aspx?scid=kb;en-us;171232

Asta
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Asta CuCommented:
FIX: Mixed security warning message appears when the POST method is used to stream a PDF file over HTTPS
When you use a POST method over HTTPS to access a server script that streams back a Portable Document Format (PDF) file, you may receive the following warning message: This page contains both secure and non-secure items. Do you want to display the...
http://support.microsoft.com/default.aspx?scid=kb;en-us;321532
"Internet Explorer Cannot Download" Error Message When You Use an HTTPS URL to Open an Office Document or PDF File
When you try to open a Microsoft Office document or a PDF file by typing an HTTPS Uniform Resource Locator (URL) for the document on the Address bar in Internet Explorer 6 Service Pack 1 (SP1), the document may not open, and you may receive the...
http://support.microsoft.com/default.aspx?scid=kb;en-us;812935
You receive an error message when you try to download a portable document format (.pdf) file from Live Meeting
Describes a problem that occurs where Internet Explorer cannot download from a .pdf file from Live Meeting.
http://support.microsoft.com/default.aspx?scid=kb;en-us;871103
Cannot Open Files on Secure Servers
When you attempt to open a file on a secure (HTTPS://) Web site, you may not be prompted whether you want to open the file from its current locations or save it to disk. Instead, a Save As dialog box may appear, prompting you to choose a location...
http://support.microsoft.com/default.aspx?scid=kb;en-us;254324
0
 
RedKelvinCommented:
give the points to astaec
0
 
Asta CuCommented:
Again, thank you very much for your diligence in finalizing these questions.
":0) Asta
0
 
oreislerCommented:
This question has been closed for a while but here is my solution to this problem, as alot of questions on this topic appear to be unanswered. (credit to others as this code snippet is a collection of other solutions).


// set the file path
			FileInfo file = new FileInfo(@"C:\file.pdf");
			// if connection is over https and in IE
			if ((Request.Browser.Browser.Equals("IE")) && (Request.ServerVariables["HTTPS"].ToLower().Equals("on")))
			{
				// Clear the content of the response
				Response.ClearContent();
				// set the cacheability for https connections
				Response.Expires = 0;
				Response.Cache.SetCacheability(System.Web.HttpCacheability.Public);
				Response.AppendHeader("Pragma", "public");				
				// Add the file name and attachment, which will force the open/cance/save dialog to show, to the header
				Response.AddHeader("Content-Disposition", "attachment; filename="+file.Name);
				// Add the file size into the response header
				Response.AddHeader("Content-Length", file.Length.ToString());
				// Set the ContentType
				Response.ContentType = "application/pdf";
				// Write the file into the response (TransmitFile is for ASP.NET 2.0. In ASP.NET 1.1 you have to use WriteFile instead)
				Response.TransmitFile(file.FullName);
				// End
				Response.End();
			}
			else
			{
				// Clear the content of the response
				Response.ClearContent();
				// LINE1: Add the file name and attachment, which will force the open/cance/save dialog to show, to the header
				Response.AddHeader("Content-Disposition", "attachment; filename="+file.Name);
				// Add the file size into the response header
				Response.AddHeader("Content-Length", file.Length.ToString());
				// Set the ContentType
				Response.ContentType = "application/pdf";
				// Write the file into the response (TransmitFile is for ASP.NET 2.0. In ASP.NET 1.1 you have to use WriteFile instead)
				Response.TransmitFile(file.FullName);
				// End the response
				Response.End();
			}

Open in new window

0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now