file upload using msvcrt

TeaAndBikkie teaandbikkie at aol.com
Wed Sep 11 20:49:06 EDT 2002


>I am trying to upload msword docs to my webserver.

I suspect the following lines...

data = fileinfo.file.read( )
if not data: break

This will break on the "not data" condition...
ie. when data is zero, "", None

So your binary file may have a zero...

read() returns empty string for EOF, so this would be better:

if data == "": break

Kind regards...




More information about the Python-list mailing list