AW: [Zope] File upload

Marc Fischer marcbpc@gmx.de
Sat, 17 Mar 2001 19:04:13 +0100


That does not work, because "REQUEST.form['file'] has always the following
value:

<ZPublischer.HTTPRequest.FileUpload instance at 1454e90>

It is never equal with ''


> -----Ursprüngliche Nachricht-----
> Von: Arno Gross [mailto:arno.gross@consotec.de]
> Gesendet: Samstag, 17. März 2001 19:30
> An: Marc Fischer; zope@zope.org
> Betreff: Re: [Zope] File upload
>
>
> Here is a DTML method called 'upLoad':
>
>    <form action="testForm" METHOD="POST">
>      <input type="FILE" name="file">
>      <input type="submit">
>    </form>
>
> Here is the DTML method called 'testForm':
>   <dtml-var REQUEST>
>   <dtml-if "REQUEST.form['file'] == ''">
>     Empty
>   <dtml-else>
>    Not Empty
>   </dtml-if>
>
> Have a nice weekend
>    Arno
>
>
>  On Sat, 17 Mar 2001, Marc Fischer wrote:
> > Learning Zope is sometimes not really funny!
> > Ok, here's another question of mine:
> >
> > In a form I give users the possibility to upload a file with
> the following
> > tag:
> >
> > <input type=file name="file">
> >
> > In the next dtml method which is called from here I want to test, if the
> > user has selected a file or not.
> > If the input field is empty, I don't want to do anything, but
> how could i
> > test?
> >
> > I tried it with: <dtml-if REQUEST.form['file']<>''> ... but
> without succes!
> >
> > Perhaps some can explain HOW and WHY, please!!!
> >
> > Best Regards, ... Marc
> >
> >
> > _______________________________________________
> > 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 )
>