[Zope] File upload
Randall F. Kern
randy@spoke.net
Sat, 17 Mar 2001 12:48:53 -0800
Use REQUEST.form['file'].filename !=3D ''
-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
>=20
>=20
> That does not work, because "REQUEST.form['file'] has always=20
> the following
> value:
>=20
> <ZPublischer.HTTPRequest.FileUpload instance at 1454e90>
>=20
> It is never equal with ''
>=20
>=20
> > -----Urspr=FCngliche Nachricht-----
> > Von: Arno Gross [mailto:arno.gross@consotec.de]
> > Gesendet: Samstag, 17. M=E4rz 2001 19:30
> > An: Marc Fischer; zope@zope.org
> > Betreff: Re: [Zope] File upload
> >
> >
> > Here is a DTML method called 'upLoad':
> >
> > <form action=3D"testForm" METHOD=3D"POST">
> > <input type=3D"FILE" name=3D"file">
> > <input type=3D"submit">
> > </form>
> >
> > Here is the DTML method called 'testForm':
> > <dtml-var REQUEST>
> > <dtml-if "REQUEST.form['file'] =3D=3D ''">
> > 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=3Dfile name=3D"file">
> > >
> > > In the next dtml method which is called from here I want=20
> 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 )
> >
>=20
>=20
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -=20
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>=20