[reportlab-users] Serving a PDF file (naming problem)

Simon reportlab-users@reportlab.com
Thu Nov 11 08:14:01 EST 2004

Have a look at the PyOpenOffice Homepage:
The skript driving the live demo contains different ways to deliver PDF 
(PDF-Mime-Type and Save-As-PDF):
Martin Simon

Tim Johnson schrieb:

>I am using the following Function:
>## code begins
>def pdf_header(file_name,size):
>    print (
>        'Content-type: application/pdf\n\n'
>        'Content-Length: %d\n'
>        'Content-Disposition: inline; filename="%s"'
>        ) % (size,file_name)
>## code ends
>A cgi program which is running from my computer as
>makes a call as a follows
>When I click on a link to the cgi program from
>Netscape (on Linux) The prompt is to save or
>open the virtual document as "kbServePDF.py",
>rather than "my_ad.pdf".
>The issue is similar on Internet Explorer: IE
>wants to save the file as kbServePDF, and if I choose
>the "All Files" option from the dialogue window,
>It is saved as "kbServePDF.pdf".
>My question is:
>  How can I get the browsers to "serve" the documents
>  as 'my_ad.pdf'?
>Thanks In advance.
>Pointers to documentation is welcome and appreciated.

More information about the reportlab-users mailing list