Re: Force Download PDF Problem



I know you're looking for something helpful - but I can say, that looks 100%
correct.. so if nothing else, it doesn't appear to be anything obvious. Good
luck

"gaubo79" <johnod1979@xxxxxxxxxxx> wrote in message
news:1135096844.290379.177790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I am wishing to force the Open|Save dialog box for a PDF and Excel
> file.
>
> I am using the following code:
>
> Response.Clear();
> Response.ContentType = "application/octet-stream";
> Response.AddHeader("Content-Disposition", "attachment; filename=" +
> saveFilename );
> Response.Flush();
> Response.WriteFile(savePath);
>
> While this works perfect for the Excel file, however, the PDF file does
> not open, whether direct from the dialog box or by saving it to disk
> and opening it, I get the following error in Adobe Acrobat Reader (v5.0
> & v7.0):
>
> "There was an error opening this document. The file is damaged and
> could not be repaired."
>
> The original PDF file is okay. Also, the size of the original PDF is
> 50k, where as the one that is downloaded to the client is 237k.
>
> I have tried various other things such as creating a FileStream and
> using Response.BinaryWrite, and various other ContentTypes, including
> application/pdf.
>
> Has anyone had this before, or know of a workaround? Ideally I would
> like the dialog box to always appear for this pdf.
>


.



Relevant Pages

  • Re: Force Download PDF Problem
    ... >> While this works perfect for the Excel file, however, the PDF file does ... >> "There was an error opening this document. ... the size of the original PDF is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Donning an investigative hat
    ... A windows 2000 networked PC belonging to abc domain, is in posession of a secretary, has a confidential Excel file lying on her local HDD. ... I check secretary's local hard disk and this pdf doc exists on local HDD but secretary maintains that she cannot recollect converting excel to doc. ... the IP from where the file reached general access PC is it was shifted thru a network drive? ...
    (Security-Basics)
  • Convert Excel to PDF from .net
    ... If IIS Server installed pdf printer, then using windows object to print ... excel file through pdf printer and save as pdf file in a folder. ... Install the PDF Object in IIS and use vb.net code to convert excel file ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Force Download PDF Problem
    ... > security on PDF documents. ... >> While this works perfect for the Excel file, however, the PDF file does ... >> "There was an error opening this document. ... the size of the original PDF is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Excel file errors Visual basic?
    ... I treid to unzip it wand ... was informed there were no zipped files in the document. ... With both links I get a zip file with the excel file and pdf. ...
    (sci.electronics.design)