Re: [Zope] File upload again
How about something like: dtml-in PyS_csvimport(fcsv.read()) prefix=pys On 14 October 2011 10:29, Jaroslav Lukesh luk...@seznam.cz wrote: Hi all, I want upload csv file for direct processing into SQL only, not for save to ZODB nor LocalFS. Upload for LocalFS already worked for me. So I have form: form method=POST enctype=multipart/form-data input type=file name=fcsv value= size=50br input type=file name=fcsv2 value= size=50br input type=submit name=fileupload value=Upload /form Diagnostic processing: dtml-var fcsv.filename::dtml-var fcsv.headers['Content-Type'] ::dtml-var fcsv And what it get: data_2011.CSV::application/vnd.ms-excel:: Su upload worked, but what I can access to data of the uploaded file? the dtml-in does not process anything, only displays NO DATA. dtml-in PyS_csvimport(fcsv) prefix=pys dtml-var pys_itembr dtml-else NO DATA /dtml-in PyS_csvimport parse CSV file by line and return array structure like this [['',''],['','']]. If I use TEXTAREA instead of file upload, dtml-in works. How to get CSV file content to processing? Many thanks, Jaroslav Lukesh PS: HTTP Request loks like that: http://myhost/csvimport/ POST /csvimport/ HTTP/1.1 Host: myhost (..) Content-Type: multipart/form-data; boundary=---30333176734664 Content-Length: 21822 -30333176734664 Content-Disposition: form-data; name=fcsv; filename=data_2011.CSV Content-Type: application/vnd.ms-excel (bulk od CSV data.) -30333176734664 Content-Disposition: form-data; name=fcsv2; filename=data_2011_kd.CSV Content-Type: application/vnd.ms-excel (bulk od CSV data.) -30333176734664 Content-Disposition: form-data; name=fileupload Upload -30333176734664-- HTTP/1.1 200 OK Server: Zope/(Zope 2.10.13-final, python 2.4.6, linux2) ZServer/1.1 Date: Fri, 14 Oct 2011 09:21:48 GMT Content-Length: 2389 Content-Type: text/html; charset=cp1250 ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev ) -- Peter Bengtsson, home www.peterbe.com fun kwissle.com work www.mozilla.com ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] File upload again
Many thanks, it works. - Puvodní zpráva - Od: Peter Bengtsson m...@peterbe.com How about something like: dtml-in PyS_csvimport(fcsv.read()) prefix=pys On 14 October 2011 10:29, Jaroslav Lukesh luk...@seznam.cz wrote: Hi all, I want upload csv file for direct processing into SQL only, not for save to ZODB nor LocalFS. Upload for LocalFS already worked for me. So I have form: form method=POST enctype=multipart/form-data input type=file name=fcsv value= size=50br input type=file name=fcsv2 value= size=50br input type=submit name=fileupload value=Upload /form Diagnostic processing: dtml-var fcsv.filename::dtml-var fcsv.headers['Content-Type'] ::dtml-var fcsv And what it get: data_2011.CSV::application/vnd.ms-excel:: Su upload worked, but what I can access to data of the uploaded file? the dtml-in does not process anything, only displays NO DATA. dtml-in PyS_csvimport(fcsv) prefix=pys dtml-var pys_itembr dtml-else NO DATA /dtml-in PyS_csvimport parse CSV file by line and return array structure like this [['',''],['','']]. ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] file upload
- Original Message - From: [EMAIL PROTECTED] To: zope zope@zope.org Sent: Monday, March 19, 2007 11:20 AM Subject: [Zope] file upload How can I make a form that people could use to upload multiple files in a time? This is not a zope issue, but... here are some options: (1) create a form that contains several file upload fields, (2) use javascript to allow the user to add more file upload fields as required, (3) get the user to upload a zip file. Jonathan ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] file upload
I know that is not a zope issue but I hope to find a python based solution becouse I'm not expert in JS. About your solutions: (1) I can't know how many file fields should be (3) I don't have smart users The solution (2) should be useful but I'm not able to find a javascript that make it possible. Thanks Illorca - Original Message - From: [EMAIL PROTECTED] To: zope zope@zope.org Sent: Monday, March 19, 2007 11:20 AM Subject: [Zope] file upload How can I make a form that people could use to upload multiple files in a time? This is not a zope issue, but... here are some options: (1) create a form that contains several file upload fields, (2) use javascript to allow the user to add more file upload fields as required, (3) get the user to upload a zip file. Jonathan -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] file upload
- Original Message - From: [EMAIL PROTECTED] To: dev101 [EMAIL PROTECTED] Cc: zope zope@zope.org Sent: Monday, March 19, 2007 11:35 AM Subject: Re: [Zope] file upload I know that is not a zope issue but I hope to find a python based solution becouse I'm not expert in JS. About your solutions: (1) I can't know how many file fields should be (3) I don't have smart users The solution (2) should be useful but I'm not able to find a javascript that make it possible. Try googling: javascript dynamically add form field Jonathan ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] File upload - get only the path - not content
Gustav Franzsen writes: This is a multi-part message in MIME format. --=_NextPart_000_003D_01C07FA3.EAFBA110 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Please do not send MIME messages into this list! ... file upload only returns filename ... Are you sure, your form method is "POST" and your "enctype" is "multipart/form-data"? form action="..." method="POST" enctype="multipart/form-data" /form Dieter ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] file upload and MySQL
=?iso-8859-1?q?J=F8rn?= Helge B. Dahl writes: So, what I do not know, is how I "extract" the information from the file upload, and make it available to my sqlMethod. This is an FAQ (answer found in the searchable list archive!). Uploaded files are "ZPublisher.HTTPRequest.FileUpload" instances. They behave like files with the additional attributes "filename" and "headers". To get the size, you may need to use "seek" (to the end) and "tell". You make this information available to an sql method as you make any parameter available for them: either: put them in the REQUEST object (-- REQUEST.set) or: call the sql method with keyword parameters Dieter ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] file upload
i want to make a section in my web page where a net surfer can come to my page and upload image files and store it in directory i created in my linux filesystem? I can't seem to figure out a way to do it in zope since it cannot access a directory in my filesystem ? Is there a way to do this ? Yep, in fact I'm playing with this right this moment. You'll want the excellent LocalFS product from Jonothan Farr which is available from: http://www.zope.org/Members/jfarr/Products/LocalFS John -- John Chandler / Software Developer / New Information Paradigms Ltd [ Linux in the office, AmigaOS in the home, PalmOS in the pocket ] The opinions above aren't those of my company... ...but then, they aren't really mine either. ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] file upload
Take a look at this product sounds like what you need. http://yyy.zope.org/Members/jfarr/Products/LocalFS -Original Message- From: Oai Luong [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 30, 2000 8:40 AM To: [EMAIL PROTECTED] Subject: [Zope] file upload i want to make a section in my web page where a net surfer can come to my page and upload image files and store it in directory i created in my linux filesystem? I can't seem to figure out a way to do it in zope since it cannot access a directory in my filesystem ? Is there a way to do this ? thanks, ___ Zope maillist - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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 )