I use Zope 2.4. I'd like to offer users to upload text files to my server in order to be manipulated by external methods written in Python. I have still found only 2 possibilities : (1) : sending files with a HTML form. But does something exist in Python to manage HTTP files sending ?? (2) : sending files by FTP. But how could I access files in Zope's file system from an external method ?? Do libraries exist to manipulate Zope filesystem ? Your solutions or suggestions are welcomed... thanks ____________________________________________________________________ - http://www.WebMailSPro.com - >> VOTRE service d'email sans pub avec VOTRE nom de domaine
Hi, another way of uploading files is using the webdav protocol which is supported by zope. I am using this as a way for users to publish onto my site. I am using this with the HTMLDocument Product. It may be a useful example to you on how to manipulate the contents of the files that you are uploading. Hope this is useful, Joe. -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Nicolas Villetard Sent: Tuesday, July 17, 2001 2:46 PM To: zope@zope.org Subject: [Zope] File transfer with Zope I use Zope 2.4. I'd like to offer users to upload text files to my server in order to be manipulated by external methods written in Python. I have still found only 2 possibilities : (1) : sending files with a HTML form. But does something exist in Python to manage HTTP files sending ?? (2) : sending files by FTP. But how could I access files in Zope's file system from an external method ?? Do libraries exist to manipulate Zope filesystem ? Your solutions or suggestions are welcomed... thanks ____________________________________________________________________ - http://www.WebMailSPro.com - >> VOTRE service d'email sans pub avec VOTRE nom de domaine _______________________________________________ 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 )
(my first post to this list, so be merciful =P) This can be pretty easily done using forms. Create a form that looks something like this (of course, you'll want to customize it): <form action="fileHandler" method="post" enctype="multipart/form-data"> <input type="file" name="myFile"><input type="submit"> </form> Then, in whatever method you choose to handle this post (in my example, fileHandler), you can manipulate the content of this file as a variable named "myFile". If you want to add this as a File object in the subfolder "files", you could use the following code: <dtml-call "files.manage_addFile(id='', file=myFile, title='A textfile')"> See the Zope API-documentation on File objects for more info. You could also refer to the file in Python, as REQUEST.form['myFile']. This can be manipulated as any file, with methods like read() etc. Interesting properties also include "filename" and "headers" (the latter contains MIME-headers for the file). Good luck! /Danni On Tuesdayen den 17 July 2001 15:45, Nicolas Villetard wrote:
I use Zope 2.4. I'd like to offer users to upload text files to my server in order to be manipulated by external methods written in Python.
I have still found only 2 possibilities :
(1) : sending files with a HTML form. But does something exist in Python to manage HTTP files sending ??
(2) : sending files by FTP. But how could I access files in Zope's file system from an external method ?? Do libraries exist to manipulate Zope filesystem ?
Your solutions or suggestions are welcomed... thanks
____________________________________________________________________ - http://www.WebMailSPro.com - >> VOTRE service d'email sans pub avec VOTRE nom de domaine
_______________________________________________ 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 )
Nicolas Villetard writes:
I'd like to offer users to upload text files to my server in order to be manipulated by external methods written in Python.
I have still found only 2 possibilities :
(1) : sending files with a HTML form. But does something exist in Python to manage HTTP files sending ?? When the file is sent with a HTML form, then sending is done by the browser and not any Python...
Alternatively, you can use ZClient ("ZPublisher.Client"), XML-RPC, FTP, WebDAV to "send" files to Zope.
(2) : sending files by FTP. But how could I access files in Zope's file system from an external method ?? Do libraries exist to manipulate Zope filesystem ? The same way, you get files into Zope, you can get them out again, e.g.
HTML ("ZPublisher.Client", "httplib", "urllib"), FTP, XML-RPC, WebDAV Dieter
participants (4)
-
Danni Efraim -
Dieter Maurer -
Joe Gaffey -
Nicolas Villetard