[Zope] Upload file and :int with :required and

Dieter Maurer dieter@handshake.de
Tue, 23 Jan 2001 23:29:36 +0100 (CET)


Hi Diego,

Diego Rodrigo Neufert writes:
 > When I use <dtml-unless "attach_file.filename">
 > 
 > I got a NameError....
This must be "NameError 'attach_file'", right?

 > Do you know a solution to this? because when I dont specify anything in a 
 > field zope just dont know about it...
Apparently, browsers behave differently. My Netscape 4.7
interpretes an empty file control as successful and sends
the corresponding name/value pair (with empty value).

To handle both behaviours, you can use:

  <dtml-unless "REQUEST.form.has_key('attach_file') and attach_file.filename">
    <!-- error; empty file control -->
  </dtml-unless>


Dieter