file upload using msvcrt

TeaAndBikkie teaandbikkie at aol.com
Thu Sep 12 02:49:06 CEST 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