Re: check uploaded file's file size?

2006-07-08 Thread h3m4n
> Try this > > fileitem.seek(0, 2) # Seek to the end of the file. > filesize = fileitem.tell() # Get the position of EOF. > fileitem.seek(0) # Reset the file position to the beginning. thanks for the info. i just had to change it from fileitem to fileitem.file, e.g. fileitem.file.seek(0, 2),

Re: check uploaded file's file size?

2006-07-08 Thread Simon Forman
h3m4n wrote: > i have a short script that allows users to upload files, but when i try > to check for a valid filesize (using fileitem) i get '-1' i can't find > information about using filesize anywhere. any ideas? > > code: > > form = cgi.FieldStorage() > fileitem = form["datafile"] > print str

check uploaded file's file size?

2006-07-07 Thread h3m4n
i have a short script that allows users to upload files, but when i try to check for a valid filesize (using fileitem) i get '-1' i can't find information about using filesize anywhere. any ideas? code: form = cgi.FieldStorage() fileitem = form["datafile"] print str(fileitem.filesize) -h3m4n