Uploading binary files

Ilariu Raducan lale at fotonation.com
Sat Jul 1 09:58:02 EDT 2000


Can we see the HTML code for the form?

"Chris Biegay" <cbiegay at objectmentor.com> wrote in message
news:Z9475.7$qm5.709 at ord-read.news.verio.net...
> I'm trying to upload files through an HTML form, but it only works
> for text files.  When I try to send a jpeg or something the process just
> hangs, and I can't even change the script afterward since the webserver
> won't release the file!  Any ideas?  This is basically how I'm doing it
now:
>
> form = cgi.FieldStorage()
> formItem = form[inputName]
>
> if formItem.file:
>     print "Received file [" + formItem.filename + "]"
>     data = formItem.file.read()
>     ...
>
>





More information about the Python-list mailing list