[Zope] how to upload a batch of files????

Trevor Toenjes zope@toenjes.com
Sat, 1 Sep 2001 17:04:18 -0400


This is a whack at the solution.
I am still learning loops, but it seems that every file would have its own
name.
Then loop through each name POSTing to a python or dtml method
'processFiles'.

Below is a linear approach.

'enterBatchFiles'
<form action="processFiles" method="post">
<input type="file" name="file1" size="25" value="">
<input type="file" name="file2" size="25" value="">
<input type="file" name="file3" size="25" value="">
<input class="form-element" type="submit" name="submit" value=" Add Files ">
</form>

I am not sure of the next syntax.

'processFiles' would include
manage_addFile(id, file="file1", title="", precondition="", content_type="")
manage_addFile(id, file="file2", title="", precondition="", content_type="")
manage_addFile(id, file="file3", title="", precondition="", content_type="")
**There might be an issue with manage_addFile confirming each submit during
this process.

Are there any experienced Zopesters that can help with this?
If ID is null, does it inherit the filename?
I am sure there is a more eloquent way.

-Trevor


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Trevor Toenjes
> Sent: Saturday, September 01, 2001 9:46 AM
> To: Robert Rottermann; zope@zope.org
> Subject: RE: [Zope] how to upload a batch of files????
>
>
> This is a great request.  I am facing this problem as well, except with
> images. I went with the one-at-a-time approach using "manage_addImage".
>
> I would like to upload several images into a folder/zClass,etc. from a
> single form.
> image1    [BROWSE]
> image2    [BROWSE]
> image3    [BROWSE]
> [ADD]
>
> My guess is that there needs to be some logic and recursion over
> the form to
> submit each image(or file) separately to "manage_addImage".
>
> -Trevor
>
>
>
> > -----Original Message-----
> > From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> > Robert Rottermann
> > Sent: Friday, August 31, 2001 3:05 AM
> > To: zope@zope.org
> > Subject: [Zope] how to upload a batch of files????
> >
> >
> > Hi there,
> > I would like to be able to upload a batch of files to Zope.
> > What I have in mind is something like having a textbox where I list the
> > files to be uploaded from where some magical function reads the
> names and
> > does the upload.
> > Is this feasible or have I to stick with a single file per action
> > approach??
> >
> > thanks for your ideas
> >
> > Robert
> > www.redcor.ch
> > don't mind my typhos I see them neither
> >
> >
> > _______________________________________________
> > 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 )