[Zope] No file in INPUT TYPE='file' field

Peter Arvidsson peter@innodev.com
Thu, 10 Aug 2000 10:06:30 +0200


Hi

I use this code to check if the input is empty:
<dtml-if "name_of_file_input.filename">
Exists...

To check if the input is a valid file you can store it as a temporary
variable and then make a check if the size of the object is more than 0
bytes like this:
<dtml-if "_.getitem(temp_object_id,0).getSize() > 0">
Valid file...

I hope this helps you :)

Peter


Alexander Chelnokov skrev:
> 
> Hello All,
> 
> How to define in DTML that user put nothing into the
> field <INPUT TYPE="file"...>?
> Give pls an example of code.
> 
> Best regards,
>  Alexander N. Chelnokov
> Ural Scientific Institute of Traumatology and Orthopaedics
> str.Bankovsky, 7. Ekaterinburg 620014 Russia
> ICQ: 25640913
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> 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 )