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
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 )
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 )
Thanks, I will try such an aproach tomorrow Robert ----- Original Message ----- From: "Trevor Toenjes" <zope@toenjes.com> To: "Trevor Toenjes" <zope@toenjes.com>; "Robert Rottermann" <robert@redcor.ch>; <zope@zope.org> Sent: Saturday, September 01, 2001 11:04 PM Subject: RE: [Zope] how to upload a batch of files????
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 )
_______________________________________________ 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 )
Trevor Toenjes writes:
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". You problem is much easier....
Use a special naming convention for your file upload controls, say all have suffix '__'. Then, in the form action, you iterate over the form variables. Python Script: r= container.REQUEST for k,v in r.form.items(): if k[-2:] == '__': # an image if v.filename: # it's not empty context.manage_addImage(chooseId(k),v) Dieter
On Fri, Aug 31, 2001 at 09:05:29AM +0200, Robert Rottermann wrote:
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??
1 - Download ZShell from http://cortex.unice.fr/~jerome/zshell/ 2 - Install it. 3 - Use its wget command. 4 - There's no 4 ! hoping this helps. Jerome Alet
Thank you for your tip. Your product sure looks powerfull. However I am looking for something I could have my users using. Something zshell is not meant for. so I am still looking. Robert ----- Original Message ----- From: "Jerome Alet" <alet@unice.fr> To: "Robert Rottermann" <robert@redcor.ch> Cc: <zope@zope.org> Sent: Saturday, September 01, 2001 8:41 PM Subject: Re: [Zope] how to upload a batch of files????
On Fri, Aug 31, 2001 at 09:05:29AM +0200, Robert Rottermann wrote:
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??
1 - Download ZShell from http://cortex.unice.fr/~jerome/zshell/
2 - Install it.
3 - Use its wget command.
4 - There's no 4 !
hoping this helps.
Jerome Alet
_______________________________________________ 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 )
Thank you for your tip. Your product sure looks powerfull. However I am looking for something I could have my users using. Something zshell is not meant for.
so I am still looking.
Zope supports WebDAV as well. You could use a WebDAV client (like that built into Windows) and let them drag and drop the files...
I understand this requirement very well. Let's take Photo images as examples. By means of Webdav or FTP I can batch upload any image, that's for sure, but it will become a standard Zope's image object, and not a Photo object. If I upload it to a Photo Folder it will be the same. So considering these two tools (FTP and Webdav), the requirement "how to batch upload within Zope?", will extend to "how to enable FTP and Webdav to know what product they must turn into the just uploaded file?" Ausum ----- Original Message ----- From: "Rob Page" <rob.page@zope.com> To: "Robert Rottermann" <robert@redcor.ch>; "Jerome Alet" <alet@unice.fr> Cc: <zope@zope.org> Sent: Saturday, September 01, 2001 3:22 PM Subject: Re: [Zope] how to upload a batch of files????
Thank you for your tip. Your product sure looks powerfull. However I am looking for something I could have my users using. Something zshell is not meant for.
so I am still looking.
Zope supports WebDAV as well. You could use a WebDAV client (like that built into Windows) and let them drag and drop the files...
_______________________________________________ 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 )
exactly right!! I would like to be able to "do" something with the uploaded file. Robert ----- Original Message ----- From: "Ausum" <augusto@artlover.com> To: "Rob Page" <rob.page@zope.com>; <zope@zope.org> Sent: Saturday, September 01, 2001 11:24 PM Subject: Re: [Zope] how to upload a batch of files????
I understand this requirement very well.
Let's take Photo images as examples. By means of Webdav or FTP I can batch upload any image, that's for sure, but it will become a standard Zope's image object, and not a Photo object.
If I upload it to a Photo Folder it will be the same. So considering these two tools (FTP and Webdav), the requirement "how to batch upload within Zope?", will extend to "how to enable FTP and Webdav to know what product they must turn into the just uploaded file?"
Ausum
----- Original Message ----- From: "Rob Page" <rob.page@zope.com> To: "Robert Rottermann" <robert@redcor.ch>; "Jerome Alet" <alet@unice.fr> Cc: <zope@zope.org> Sent: Saturday, September 01, 2001 3:22 PM Subject: Re: [Zope] how to upload a batch of files????
Thank you for your tip. Your product sure looks powerfull. However I am looking for something I could have my users using. Something zshell is not meant for.
so I am still looking.
Zope supports WebDAV as well. You could use a WebDAV client (like that built into Windows) and let them drag and drop the files...
_______________________________________________ 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 )
Ausum writes:
I understand this requirement very well.
Let's take Photo images as examples. By means of Webdav or FTP I can batch upload any image, that's for sure, but it will become a standard Zope's image object, and not a Photo object. You need a PUT_factory. See the HowTo on Zope.org....
Dieter
I'd take a look at LocalFS Product. Although it's for other sort of things, you could see how it works the reading of files contained in a path. After that you could use manage_addProduct of your desire to the resulting list of files. It might be necessary to hack the current method to not to response a confirmation, when batch loading. Ausum ----- Original Message ----- From: "Robert Rottermann" <robert@redcor.ch> To: "Jerome Alet" <alet@unice.fr> Cc: <zope@zope.org> Sent: Friday, August 31, 2001 3:17 PM Subject: Re: [Zope] how to upload a batch of files????
Thank you for your tip. Your product sure looks powerfull. However I am looking for something I could have my users using. Something zshell is not meant for.
so I am still looking.
Robert
----- Original Message ----- From: "Jerome Alet" <alet@unice.fr> To: "Robert Rottermann" <robert@redcor.ch> Cc: <zope@zope.org> Sent: Saturday, September 01, 2001 8:41 PM Subject: Re: [Zope] how to upload a batch of files????
On Fri, Aug 31, 2001 at 09:05:29AM +0200, Robert Rottermann wrote:
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??
1 - Download ZShell from http://cortex.unice.fr/~jerome/zshell/
2 - Install it.
3 - Use its wget command.
4 - There's no 4 !
hoping this helps.
Jerome Alet
_______________________________________________ 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 )
Thanks, however I understand LocalFS only deals with files on the server which is not what I need. Robert ----- Original Message ----- From: "Ausum" <augusto@artlover.com> To: "Robert Rottermann" <robert@redcor.ch>; <zope@zope.org> Sent: Saturday, September 01, 2001 10:40 PM Subject: Re: [Zope] how to upload a batch of files????
I'd take a look at LocalFS Product. Although it's for other sort of things, you could see how it works the reading of files contained in a path. After that you could use manage_addProduct of your desire to the resulting list of files. It might be necessary to hack the current method to not to response a confirmation, when batch loading.
Ausum
----- Original Message ----- From: "Robert Rottermann" <robert@redcor.ch> To: "Jerome Alet" <alet@unice.fr> Cc: <zope@zope.org> Sent: Friday, August 31, 2001 3:17 PM Subject: Re: [Zope] how to upload a batch of files????
Thank you for your tip. Your product sure looks powerfull. However I am looking for something I could have my users using. Something zshell is not meant for.
so I am still looking.
Robert
----- Original Message ----- From: "Jerome Alet" <alet@unice.fr> To: "Robert Rottermann" <robert@redcor.ch> Cc: <zope@zope.org> Sent: Saturday, September 01, 2001 8:41 PM Subject: Re: [Zope] how to upload a batch of files????
On Fri, Aug 31, 2001 at 09:05:29AM +0200, Robert Rottermann wrote:
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??
1 - Download ZShell from http://cortex.unice.fr/~jerome/zshell/
2 - Install it.
3 - Use its wget command.
4 - There's no 4 !
hoping this helps.
Jerome Alet
_______________________________________________ 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 )
To put this thread in a context: http://www.softartisans.com/softartisans/sajfile.html Ausum ----- Original Message ----- From: "Robert Rottermann" <robert@redcor.ch> To: "Ausum" <augusto@artlover.com>; <zope@zope.org> Sent: Friday, August 31, 2001 6:12 PM Subject: Re: [Zope] how to upload a batch of files????
Thanks, however I understand LocalFS only deals with files on the server which is not what I need.
Robert ----- Original Message ----- From: "Ausum" <augusto@artlover.com> To: "Robert Rottermann" <robert@redcor.ch>; <zope@zope.org> Sent: Saturday, September 01, 2001 10:40 PM Subject: Re: [Zope] how to upload a batch of files????
I'd take a look at LocalFS Product. Although it's for other sort of things, you could see how it works the reading of files contained in a path. After that you could use manage_addProduct of your desire to the resulting list of files. It might be necessary to hack the current method to not to response a confirmation, when batch loading.
Ausum
----- Original Message ----- From: "Robert Rottermann" <robert@redcor.ch> To: "Jerome Alet" <alet@unice.fr> Cc: <zope@zope.org> Sent: Friday, August 31, 2001 3:17 PM Subject: Re: [Zope] how to upload a batch of files????
Thank you for your tip. Your product sure looks powerfull. However I am looking for something I could have my users using. Something zshell is not meant for.
so I am still looking.
Robert
----- Original Message ----- From: "Jerome Alet" <alet@unice.fr> To: "Robert Rottermann" <robert@redcor.ch> Cc: <zope@zope.org> Sent: Saturday, September 01, 2001 8:41 PM Subject: Re: [Zope] how to upload a batch of files????
On Fri, Aug 31, 2001 at 09:05:29AM +0200, Robert Rottermann wrote:
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??
1 - Download ZShell from http://cortex.unice.fr/~jerome/zshell/
2 - Install it.
3 - Use its wget command.
4 - There's no 4 !
hoping this helps.
Jerome Alet
_______________________________________________ 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 )
_______________________________________________ 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 )
Robert Rottermann writes:
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?? Zope by itself cannot reach your client machine. It needs help by a program running on that machine.
Options: * Can you not use "load_site" to upload the files? * Recently, there has been a discussion about Drag&Drop into Zope. Instead of entering the name of file to upload in a textbox (quite tedious and error prone) you would simply drag&drop the files (much easier). It is not yet clear how to implement the D&D. Search the archives for the thread. Dieter
Thank you for your Tips, I was not aware of the load_site tool. I will have a look at it. (however it seems not to be zope based) I have been pondering drag an drop before without yet getting to a decent solution. However my real problem is that I must somehow initiate the file transfer by simulating the user imitated file selection/transfer. I am just wondering if I could have a html form with a prefilled input tag of type file and a "submit on load" JavaScript. I will try this tomorrow. Would be scary if it works. Guet nacht mittenand Robert ----- Original Message ----- From: "Dieter Maurer" <dieter@handshake.de> To: "Robert Rottermann" <robert@redcor.ch> Cc: <zope@zope.org> Sent: Saturday, September 01, 2001 11:37 PM Subject: Re: [Zope] how to upload a batch of files????
Robert Rottermann writes:
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?? Zope by itself cannot reach your client machine. It needs help by a program running on that machine.
Options:
* Can you not use "load_site" to upload the files?
* Recently, there has been a discussion about Drag&Drop into Zope. Instead of entering the name of file to upload in a textbox (quite tedious and error prone) you would simply drag&drop the files (much easier). It is not yet clear how to implement the D&D.
Search the archives for the thread.
Dieter
participants (6)
-
Ausum -
Dieter Maurer -
Jerome Alet -
Rob Page -
Robert Rottermann -
Trevor Toenjes