SSL Response.WriteBinary()

From: Adam B (anonymous_at_discussions.microsoft.com)
Date: 12/04/03


Date: Thu, 4 Dec 2003 07:57:18 -0800

Hello. I'm writing an aspx page that reads a file from
disk and writes the file out through the
Response.WriteBinary() method. This allows me to support
security and custom reports for various users. I am
adding the MIME type for the type of file that I am
writing out to the response. Example:

if ( reportName.ToLower().EndsWith(".pdf"))
{
                
        Response.ContentType="application/pdf";
        Response.AddHeader( "content-
disposition","filename=StaticContentViewer.pdf");
}
if ( reportName.ToLower().EndsWith(".doc"))
{
        Response.ContentType = "application/msword" ;
        Response.AddHeader( "content-
disposition","filename=StaticContentViewer.doc");
}

This seems to work great on a regular non-secure site.
The problem that I am having is on a secure site (https).
I get errors in when trying to access PDF files or
MSOffice Files (doc,xls, etc) through my IE browser (IE
6). The browser just hangs on the MSOffice files and they
never open. On the PDF files, I get a warning about secure
and nonsecure info on and it will open. I know that the
pdf doesn't contain any nonsecure info, because I put the
same file on the site directly and did not receive the
error. Also, I get a javascript error when I close the
PDF.

I have looked around on many message boards and found the
following suggestion:

Response.AddHeader( "pragma","no-cache");

This did not work for me or many of the other developers
out there with the same problem.

Thanks in advance for any help or suggestions!

Adam



Relevant Pages

  • Re: Position reporting function: Flanagan, Yahoo!, Kruze, Prototype ... all broken at least a little
    ... Does anyone have position reporting code that doesn't ... browser sniff and also works in these versions of Opera and Safari? ... entire idea of writing a general-purpose position-finding function. ...
    (comp.lang.javascript)
  • Re: [OT] Geography lesson
    ... and they'll go elsewhere for their business... ... MS is by far the dominent OS and browser provider ... pretty much as soon as Windows hit the scene. ... all that to a new level, where writing compliant code meant you were ...
    (rec.autos.sport.f1)
  • Re: Copy HTML output to VB.net
    ... Perhaps the size of the browser window? ... break it down into an exact set of requirements. ... my program I am writing in VB.net. ...
    (microsoft.public.dotnet.general)
  • Re: Page refresh throws JavaScript error
    ... the point when they open but opening the alert has consequences. ... is racing the browser will be radically altered). ... Non-blocking reporting that does not take focus used to be commonly ... browsers increasingly default to not allowing status bar writing by ...
    (comp.lang.javascript)
  • Handing off a file to the browser
    ... cgi on a server (which I'm also writing). ... "hand off" a good response for the browser to handle. ...
    (comp.lang.javascript)

Loading