AW: [Zope] File upload

Marc Fischer marcbpc@gmx.de
Sat, 17 Mar 2001 22:20:02 +0100


Thank you, ... that's it!

> -----Ursprüngliche Nachricht-----
> Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von
> Randall F. Kern
> Gesendet: Samstag, 17. März 2001 21:49
> An: Marc Fischer; Arno Gross; zope@zope.org
> Betreff: RE: [Zope] File upload
>
>
> Use REQUEST.form['file'].filename != ''
>
> -Randy
>
> > -----Original Message-----
> > From: Marc Fischer [mailto:marcbpc@gmx.de]
> > Sent: Saturday, March 17, 2001 10:04 AM
> > To: Arno Gross; zope@zope.org
> > Subject: AW: [Zope] File upload
> >
> >
> > 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 )
> > >
> >
> >
> > _______________________________________________
> > 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 )
>