Setting default filename for download
Hello, I want to offer some PDF documents for download by a script. I do this by response = container.REQUEST.RESPONSE pdf = <some code> name = <some reasonable name for this pdf> response.setHeader('Content-type', 'application/pdf' ) response.setHeader('Content-Length', len(pdf)) return pdf I just want to realize that the downloader gets a sane default name for the file to download which is stored in the variable "name" instead of just the name of the script which returns the pdf. How can I specify this? Kind regards Andreas. -- Mankind must put an end to war before war puts an end to mankind. John F. Kennedy
Andreas Tille wrote at 2003-3-24 15:51 +0100:
I want to offer some PDF documents for download by a script. I do this by
response = container.REQUEST.RESPONSE
pdf = <some code> name = <some reasonable name for this pdf>
response.setHeader('Content-type', 'application/pdf' ) response.setHeader('Content-Length', len(pdf)) return pdf
I just want to realize that the downloader gets a sane default name for the file to download which is stored in the variable "name" instead of just the name of the script which returns the pdf.
How can I specify this?
Search (Google) for "Content-Disposition". Dieter
participants (2)
-
Andreas Tille -
Dieter Maurer