Article View: adobe.acrobat.reader
Article #873Incorrect filename in Acrobat 6.0 when saving PDF from ASP
From: Vegard Bakke
Date: Mon, 19 Apr 2004 13:36
Date: Mon, 19 Apr 2004 13:36
44 lines
2539 bytes
2539 bytes
This question includes both ASP (VBScript) and Adobe Acrobat/Reader
6.0. But I think the problem lies within Acrobat. If the ASP is
wrong, please tell me how to correct it.
Our web server controls access to pdf-documents with ASP pages. I use
the ADODB.Stream object to transfer the pdf (according to
http://support.microsoft.com/?id=276488), using
Response.AddHeader "Content-Disposition", "inline;
filename=test.pdf"
to indicate the filename. (Source listing below.)
IE recognises the filename as �test.pdf' (easy to test by swapping
�inline' with �attachment'). However, Acrobat's "Save a Copy" insists
that the file is called �loadpdf.pdf'. And, "Email" � "Send Copy" does
not include the attachment at all.
For PDF's that are publicly available, directly through a URL, "Save a
Copy" and "Email" work as expected.
Why doesn't Acrobat suggest the filename 'test.pdf'? Is this a problem
in Acrobat? Or is my code incorrect? More importantly, is it possible
to solve, and how? Any suggestions are welcome.
Cheers,
Vegard
I am using IE 6.0 on WinXP and Adobe Acrobat 6.0.1. A short test
version of my ASP code follows:
Const adTypeBinary = 1
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile "test.pdf"
Response.Clear
Response.ContentType = "application/pdf"
Response.AddHeader "Content-Disposition", "inline;
filename=test.pdf"
Response.BinaryWrite objStream.Read
Response.End
objStream.Close
Set objStream = Nothing
Technical Details
Message-ID:
<33a013af.0404190536.6de61233@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 109513,22a50d86fb3ff0e9,start X-Google-Attributes: gid109513,public X-Google-Thread: 107c4e,22a50d86fb3ff0e9,start X-Google-Attributes: gid107c4e,public X-Google-ArrivalTime: 2004-04-19 06:36:45 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: vegard@mail.com (Vegard Bakke) Newsgroups: adobe.acrobat.reader,microsoft.public.inetserver.asp.general Subject: Incorrect filename in Acrobat 6.0 when saving PDF from ASP Date: 19 Apr 2004 06:36:45 -0700 Organization: http://groups.google.com Lines: 44 Message-ID: <33a013af.0404190536.6de61233@posting.google.com> NNTP-Posting-Host: 80.203.189.254 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1082381805 2836 127.0.0.1 (19 Apr 2004 13:36:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 19 Apr 2004 13:36:45 +0000 (UTC)