Python file upload

Simo Salminen look at sig.invalid
Wed Jun 26 06:27:16 EDT 2002


* Bjarne Christiansen [Wed, 26 Jun 2002 08:08:26 +0000]
> Hi,
> I have some problems uploading binary files though the web browser. It seens 
> to work fine when uploading ACII file but but binary files seems to be 
> currupted. The begining of the binary file seems fine, but some data is 
> missing....
> 
> Here is my file upload script:
> 
> #!c:\Python\python -d

see http://www.python.org/cgi-bin/faqw.py?req=show&file=faq07.012.htp

>     data1 = cgi.escape(data)
>     f = open("file1.jpg","wb")
>     f.write(data1)

>>> cgi.escape.__doc__
"Replace special characters '&', '<' and '>' by SGML entities."

why would you cgi.escape the data?

--
simo <dot> salminen <at> iki <dot> fi



More information about the Python-list mailing list