It uploads only a part of the file. Is it a feature of Windows implementation?
<!-- The form-->
<FORM METHOD="POST" ACTION="/cgi-bin/test.py" enctype="multipart/form-data">
<INPUT TYPE=FILE NAME="filename" size=40>
<INPUT TYPE="SUBMIT" VALUE="Upload">
</FORM>
# test.py
print "Content type: text/html"
print
import cgi
form=cgi.FieldStorage()
if form.has_key("filename"):
filedata=form.getvalue("filename", "")
assert filedata == form["filename"].value # the same
print len(filedata), '<br>' # some 400..800 bytes depending on file :-(
fstrm = open("test.bin", 'wb')
fstrm.write(filedata)
fstrm.close()