[EMAIL PROTECTED] writes:
 > There's a way to get the size of a file uploaded in a form before write it?
I am not sure, what type of object is used at the base of
"FileUpload" objects (to give them there file like behaviour).

If this a "cStringIO" objects, they may have a "len" attribute.
This means, you could use "your_uploaded_file.len" to get the
length.

Otherwise, you could try:

           file.seek(0,2)       # positions at the end
           len= file.tell()     # tells the current position (i.e. the length)
           file.seek(0,0)       # positions at the start

That's Python code.
You can do something equivalent in several DTML commands.


Dieter

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to