[Zope] File uploader

Jens Vagelpohl jens@zope.com
Fri, 17 Aug 2001 14:39:56 -0400


the line "<dtml-with "folders/folder1">" won't work. you cannot use path=20=

notation in this statement. it is interpreted as "folders divided by=20
folder1", and folder objects do not define a division operator =
(__div__).

try something like <dtml-with "folders.folder1">

jens




On Friday, August 17, 2001, at 02:27 , Todd Loomis wrote:

> Eric:
>
> When I use the code bleow I have no problem uploading a file:
>
> <dtml-with "folders">
> =A0=A0=A0 <dtml-call expr=3D"manage_addFile(id=3DREQUEST['FileName'], =
file=3DREQUEST[
> 'file'])">
> </dtml-with>
> <dtml-call "RESPONSE.redirect('./index_html')">
>
> However if I want to upload to another folder within the folder i get=20=

> this error:
>
> Error Type: AttributeError
> Error Value: __div__
>
> Here's the code I used:
>
> <dtml-with "folders/folder1">
> =A0=A0=A0 <dtml-call expr=3D"manage_addFile(id=3DREQUEST['FileName'], =
file=3DREQUEST[
> 'file'])">
> </dtml-with>
> <dtml-call "RESPONSE.redirect('./index_html')">
>
> How can I or can this be done?
>
> Thanks,
> Todd
>
> At 09:46 AM 8/17/2001 -0700, you wrote:
>
> Todd,
> Are you using a LocalFS object or trying to store the files as Zope =
File
> objects?
> Eric.
>
> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of =
Todd
> Loomis
> Sent: Friday, August 17, 2001 9:04 AM
> To: eric@walstads.net; zope@zope.org
> Subject: RE: [Zope] File uploader
>
>
> I keep getting this error after trying this code:
>
> Error Type: NameError
> Error Value: manage_upload
>
>
> At 08:50 AM 8/17/2001 -0700, you wrote:
> >Hi Todd,
> >Do you want to store your files on the local file system or in Zope =
as=20
> File
> >objects?
> >Either way, have a look at how the 'Add File' form works in Zope.=A0 =
That'
> ll
> >show you how to get the file up to Zope.=A0 =46rom there you will =
need to=20
> move
> >it to the folder you want.
> >I upload to a LocalFS object ('data').
>