Simple python cgi question

Wilk wilkSPAM at OUTflibuste.net
Thu Sep 18 09:28:06 CEST 2003


Stephen Boulet <stephen at SPAM.theboulets.IS.BAD.net> writes:

> I don't want report lab since I'll be using lilypond to generate the
> pdfs (I mentioned that I'd be calling the pdf generating program from
> python).
>
> What I needed to know was how to upload a file, really. I thought it
> might be trivial, but maybe not so ...

Yes it's trivial, you'll retreive the file with cgi.FieldStorage(),
you'll pass it to your local app with popen (a pipe) and retreive the
pdf with the pipe or open (a file), control the size of the buffer and
send the result with print.

Before, you'll print the right header content-type: application/pdf

bye

-- 
William Dode - http://flibuste.net




More information about the Python-list mailing list