Re: Response.ContentType = "Application/pdf"

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Response.AddHeader("Content-Disposition", "inline;filename="Filename.pdf")
This result in a blank screen. Right-clicking on the form to view source for
curiosity show this message:
"The XML source file is unavailable for viewing" --> But I have not added
anything XML-like to my form.
Note, I retrieve the pdf from a SQL server, using
"Response.BinaryWrite(FileByte)" as output.

Response.AddHeader("Content-Disposition",
"attachment;filename="Filename.pdf")
This causes the download box to appear. Ok for the moment, but not as
intended.

I just don't know why this happens. Maybe something in the @ page area or in
the html-header of the file?
Or in the settings of the browser?

Bjorn

"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <Steve@xxxxxxx> wrote in
message news:BFA4B09F-E1BA-45DF-A8D3-872CD60A165D@xxxxxxxxxxxxxxxx
Try adding this line:
Response.AddHeader("Content-Disposition",
"inline;filename="Filename.pdf");

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net


"Bjorn Sagbakken" <bjo-sag@xxxxxxxxx> wrote in message
news:xYidnXKxw-4NO8HbRVnzvAA@xxxxxxxxxxxxxx
With ASP.NET 2.0
I'm trying to display the pdf file directly in the client browser, but I
only get a download dialogue box. Downloading the file works fine, but I
want to view the PDF directly.

I get the same response with:

Response.ContentType="Application/X-unknown" which is more
understandable.

The Response.ContentType="Application/pdf" doesn't seem to tell the
browser that this actually is a PDF-file.

Mybe there is only a mistyping, but I shuld like a complete list of the
options for ContentType, like what phrase to use for all kind of files.
Anyone that knows where to find this?

(I have searched through help without finding a listing of all the
filetypes available)

Bjorn




.



Relevant Pages

  • Re: Opening an adobe file
    ... What did you plan to USE to read the .pdf file? ... My question is does any part of the document need to download, ... when I view an online PDF am I viewing it completely ... Current advice says that allowing your browser to display embedded ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: TeX/LaTeX isnt easy
    ... By that logic, all links to PDF files are "marked", since ... documentation inadequate to decide whether to go ahead and download ... Sumatra PDF, any web browser with a PDF plug-in, and plenty of others. ... We were discussing Acrobat Reader, ...
    (comp.text.tex)
  • Re: Song help
    ... To download a score in PDF format, simply click on the little red PDF ... your machine in Acrobat Reader, and then click on the file save icon ... your browser to handle PDF files. ...
    (rec.music.early)
  • Re: Need suggestions for C links.
    ... Whenever I make the mistake of clicking on a hyperlink to a PDF ... my browser asks me if I want to download some Adobe ... I use Firefox for browsing, and it has been told to simply ...
    (comp.lang.c)
  • Re: Potters favorite computer programs.
    ... > They can be download from the Internet and most are free. ... > 5D PDF - Creates PDF files via the print command. ... > Microsoft PhotoStory - use to make pictures into DVDs and videos. ... > CDBank - reads in and catalogs the directories of your disk drives, ...
    (sci.physics)