Save As dialog box appearing twice

windows

Guest
I have an ASP page set up so that the user has three options. Display addresses on the screen in html, save the addresses in an Excel spreadsheet, or save them as a PDF (I have the page making the PDFs from scratch). The display works fine, the save as Excel works fine, but when the user tries to get the PDF, a Save As dialog box comes up. If they click save to file, it saves fine, if they click Open This File from Current Location it brings up the same SaveAs box again. If they click save to file, it does so. If they click Open it opens like it's supposed to.<br />
Why is it coming up twice? <br />
<br />
I'm guessing this is a Content-Type type question so that's why I'm asking here in the HTML forum and not the ASP forum. <br />
<br />
thanks in advance!<!--content-->and how are you getting them to save a pdf without opening it.<!--content-->My ASP page generates the PDF and then displays it as the page itself. Here's a little pseudo code of what it does:<br />
If (pdf) then ContentType = application/pdf and AddHeader "content-disposition","attachment; filename=CompanyContact.pdf"<br />
.<br />
.<br />
.<br />
response.write "%PDF-1.4" <br />
<br />
it basically generates a big text file that is the PDF itself.<!--content-->well yes I understand you generating it but how is the browser Download <!--more-->ing it when it should be opening it. if the browser doesn't have the plug-in then it will auto Download <!--more--> it.<br />
<br />
sounds like your code is getting ran twice.<!--content-->How is it Download <!--more-->ing it when it should be opening it? I'm not sure. <br />
<br />
If the code is getting run twice then when I have it save to file, wouldn't it ask again just like telling it to open?<!--content-->well if I click on a pdf link it goes right to opening it. no questions asked. why yours it coming up with one is the strange question. the only answer I can give you is that something is not right with your plug-in or you are sending the wrong content-type to the browser.<!--content-->What's being sent to the browser is the ContentType for PDF, a header for attachment, and the PDF data itself.<br />
It's essentially making the actual html page into the PDF.<br />
I wonder if it would be better to write the file to the server and have it sent. I know having a link to a PDF works (it automatically opens it).<br />
I guess I'm at a loss of what more info to give because the Excel part is basically the same thing and it works right. Takes the HTML page, "renames" it to xls, and it comes up to the save as box.<!--content-->maybe that is it. you sent the pdf header and you are also sending it as an attatchment. maybe you are confusing the browser<!--content-->Well I found a solution to my problem. I removed the added Header for the file attachment and the PDF pops up in the browser. Now to figure out WHY it works :D <br />
<br />
Thank you scoutt for your time. I appreciate your quick responses.<!--content-->
 
Back
Top