[Zope] No file in INPUT TYPE='file' field
   
    Mabe, Brad
     
    BRADLEY.D.MABE@saic.com
       
    Fri, 11 Aug 2000 09:14:08 -0400
    
    
  
I love this list!  I am designing a file upload form and just started
thinking about how I am going to handle invalid filenames, no filename, etc.
Of course, rather than doing "real work" I decided to take some time and
catch up with my e-mail and viola! Here is this thread.
Thanks Peter!
        -=Brad=-
-----Original Message-----
From: Peter Arvidsson [mailto:peter@innodev.com]
Sent: Thursday, August 10, 2000 4:07 AM
To: Alexander Chelnokov
Cc: zope
Subject: Re: [Zope] No file in INPUT TYPE='file' field
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 )
_______________________________________________
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 )