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

Matej Pivoluska reportlab-users@reportlab.com
Thu Nov 11 09:06:28 EST 2004


D=F2a =A9t 11. November 2004 01:28 Tim Johnson nap=EDsal(a):
> I am using the following Function:
> ## code begins
> def pdf_header(file_name,size):
>     print (
>         'Content-type: application/pdf\n\n'

Why you print *two* newlines there? (In HTTP is header splitted from body b=
y a=20
blank line!

>         'Content-Length: %d\n'
>         'Content-Disposition: inline; filename=3D"%s"'
>         ) % (size,file_name)
> ## code ends
> A cgi program which is running from my computer as
> http://localhost/cgi-bin/baker/kbServePDF.py
> makes a call as a follows
> pdf_header('my_ad.pdf',1)

> ...

> My question is:
>   How can I get the browsers to "serve" the documents
>   as 'my_ad.pdf'?

>...

mP
=2D-=20
http://pivoluska.matfyz.cz/weblog



More information about the reportlab-users mailing list