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

Erik Stephens reportlab-users@reportlab.com
Thu Nov 11 00:47:02 EST 2004

On Nov 10, 2004, at 5:28 PM, Tim Johnson wrote:

> 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)

Don't end the Content-type line with two newlines.  In HTTP, two 
newlines signals the end of headers.  You should be seeing the other 
header lines in the file you downloaded.


More information about the reportlab-users mailing list