[Zope] filesize of uploaded file

ender kthangavelu@earthlink.net
Sun, 15 Jul 2001 21:43:17 -0700


On Monday 16 July 2001 01:19 am, Peter Bengtsson wrote:
>>I know this question's been posted before but I can't find it at nipltd.com
>>so I post it again.
>>
>>How to find the size of a uploaded file?


# assuming file pointer is at the beg. of the file

f = REQUEST.file
f.seek(0,2)
size = f.tell()
f.seek(0,0)
print 'file is this long,  %s bytes'%str(size)


cheers

kapil