Be mindful, that using <@length on the pdf data to get the content- length works 99% of the time, but will be a byte or so off 1% of the time or so, and will cause the client to not work right. This is a issue with witango. Search the archives, you may need to use an external method to accurately calc bytes, or use a db to do so, etc.

--

Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/

On May 8, 2008, at 11:06 AM, Stefan Gonick wrote:

Hi Robert,

Thank you very much for this. You're a great help.

Stefan

At 01:02 AM 5/8/2008, you wrote:
All you have to do, is create a taf that reads in the DATA of the pdf file, create your own custom header and serve the data out. The custom header MUST have a correct content-length, or it won't be compatible with all browsers. content-type should be application/ pdf, and THIS IS THE IMPORTANT PART, content-disposition needs to be:

attachment; filename=thefilename.pdf

Substitute "thefilename.pdf" with the filename you wish. You can also even do this with JPEGs or other image formats, and the browser will not display, but instead download. I use this technique in witango and php on several sights in production.

--

Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/

On May 7, 2008, at 7:38 AM, Stefan Gonick wrote:

Hi Everyone,

I need to create a link to a PDF file that immediately brings up a download dialog
instead of opening the file. Does anyone know how to do this?

Thanks,
Stefan

=====================================================
Database WebWorks: Dynamic web sites through database integration
http://www.DatabaseWebWorks.com

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf


________________________________________________________________________
TO UNSUBSCRIBE: Go to

http://www.witango.com/developer/maillist.taf
=====================================================
Database WebWorks: Dynamic web sites through database integration
http://www.DatabaseWebWorks.com

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf


________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to