SSL Response.WriteBinary problem

Discussion in 'ASP General' started by Adam B, Dec 4, 2003.

  1. Adam B

    Adam B Guest

    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
    Adam B, Dec 4, 2003
    #1
    1. Advertising

  2. Adam B

    Ray at Guest

    Ray at, Dec 4, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adam B

    SSL Response.WriteBinary()

    Adam B, Dec 4, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,043
    Adam B
    Dec 4, 2003
  2. Sean Wolfe
    Replies:
    1
    Views:
    2,227
    Joerg Jooss
    Apr 28, 2005
  3. Ryan Pedersen
    Replies:
    1
    Views:
    2,168
    Daniel Fisher\(lennybacon\)
    Jul 12, 2005
  4. Earthbound
    Replies:
    4
    Views:
    658
    Alexey Smirnov
    Apr 25, 2008
  5. Adam B

    SSL Response.WriteBinary()

    Adam B, Dec 4, 2003, in forum: ASP .Net Security
    Replies:
    0
    Views:
    108
    Adam B
    Dec 4, 2003
Loading...

Share This Page