This header works: <@PURGERESULTS><@assign name="encodeResults" scope="request" value="false"><@ASSIGN NAME="httpHeader" SCOPE="request" encoding="none" VALUE="HTTP/1.1 200 OK<@CRLF>Server: Apache 2.0.046<@CRLF>Accept-Ranges: bytes<@CRLF>Content-Type: @@request$media[1,1]<@CRLF>Content-Disposition: inline; filename=@@request$media[1,2]<@CRLF>Last-Modified: <@VAR NAME="media[1,3]" scope="request" format="datetime"><@CRLF>Content-Length: @@request$media[1,4]<@CRLF><@CRLF> "><@VAR NAME="media[1,5]" SCOPE="request" ENCODING="none">
Note that all items are pulled from the media table of the db (mySQL). Also, check whether the PDF downloads correctly in browsers other than IE (eg. Mozilla). It took me quite some time to debug a problem with IE pdf downloads. It turned out that my content-length (@@request$media[1,4] above) was 1 byte longer than the actual PDF file. I never determined how the length got improperly set in the db (it's determined by a file upload taf), but after correcting the file length in the db, everything worked. See also: http://support.microsoft.com/default.aspx?kbid=305153 >Thanks Ben, > >That was one of the first things I tried. It didn't make any difference. >Have you had the file/save work properly? > >Dave > >-----Original Message----- >From: Ben Johansen [mailto:[EMAIL PROTECTED] >Sent: October 30, 2003 1:18 PM >To: [EMAIL PROTECTED] >Subject: RE: Witango-Talk: PDFs and http headers > >I use >Content-Disposition: attachment; filename= > >Ben Johansen - http://www.pcforge.com >Authorized Witango & MDaemon Reseller >Available for Witango Developement >-----Original Message----- >From: Dave Shelley [mailto:[EMAIL PROTECTED] >Sent: Thursday, October 30, 2003 9:04 AM >To: [EMAIL PROTECTED] >Subject: Witango-Talk: PDFs and http headers > >Hi, > >I have a document management system as part of a larger application, and >I'm having a problem that maybe others have had too. When a user >requests a document with a url like getDoc.taf?docID=123, the server >reads the file from a secured area, formats the http header and document >is automatically opened in Adobe Reader. That all works fine. The >problem is when the user does a file/save. The filename defaults to >getDoc.pdf rather than the actual filename. > >The http header looks like this: >HTTP/1.1 200 OK >Content-Type: application/pdf >Content-Length: 3944 >Content-Disposition: inline; filename="someFileName.pdf" > >File/save should save it as someFileName.pdf. Has anyone else >experienced this problem or know of a solution? > >If I change the Content-Type to application/download, the user is >prompted to open or save the file, and the save filename is correct. But >we want it to open automatically in Adobe. Also if they choose to open >the file, then do a file save, the default filename is >someFileName[2].pdf > >Setup is: Win2003, IIS, Witango 5, mySQL, IE 6, Adobe Reader 6.0 > >Thanks. >Dave Shelley > > >________________________________________________________________________ > >TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf > > >________________________________________________________________________ > >TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf > >________________________________________________________________________ >TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf Bill Conlon To the Point 345 California Avenue Suite 2 Palo Alto, CA 94306 office: 650.327.2175 fax: 650.329.8335 mobile: 650.906.9929 e-mail: mailto:[EMAIL PROTECTED] web: http://www.tothept.com ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
