[Zope] verify whether html <input type=file... is empty

James Sintz jsintz@ohiohistory.org
Wed, 17 Jan 2001 12:04:25 -0500


Andrey,

One way would be to simply test for it on your form action page.

<dtml-if "image_1 == ''">
  <p>Sorry! You need to include an image.</p>
<dtml-else>
  <dtml-call "manage_addImage( id=imageId, file=REQUEST[ image_1],
REQUEST=REQUEST )">
</dtml-if>

Jamey

> -----Original Message-----
> From:	Andrei Belitski [SMTP:andrei.belitski@student.uni-tuebingen.de]
> Sent:	Wednesday, January 17, 2001 9:16 AM
> To:	zope@zope.org
> Subject:	[Zope] verify whether html <input type=file... is empty
> 
> Hi!
> Don't know if it is really a zope question, but I have a problem,
> verifying if e.g. input
> <INPUT TYPE="file" NAME="image_1" SIZE="50">
> is empty or not using
>     <dtml-unless " REQUEST[ 'image_1']=='' ">
>        <dtml-call "manage_addImage( id=imageId, file=REQUEST[ image_1],
> REQUEST=REQUEST )">
>     </dtml-unless>
> well, I think the <input type=file... is not a string, but what I want
> to test is if the user put in the filename and not whether the really
> existing file is empty, so how could aI do it?
> 
> I would appreciate any hints
> Thank you in advance
> Andrey
> 
> _______________________________________________
> 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 )