[Zope] Batch upload to FileLibrary?

Chen Fu novalet@yahoo.com.cn
Fri, 2 May 2003 16:55:48 +0800 (CST)


Hi!
My insitute want a simple File share server to
exchange file between us. I play with the examples
FileLibrary in zope2.6 these days. And suggest to add
some keyword or abstract features in FileLibrary will
make it a good candidate :)
I try to write a python client(not web interface) to
upload and download some files in batch. By search on
google and python manual, i think it is something to
do with httplib. There is a simple demo in python doc
of the usage of "POST" method. 

=================================================
>>> import httplib, urllib
>>> params = urllib.urlencode({'spam': 1, 'eggs': 2,
'bacon': 0})
>>> headers = {"Content-type":
"application/x-www-form-urlencoded",
...            "Accept": "text/plain"}
>>> conn =
httplib.HTTPConnection("musi-cal.mojam.com:80")
>>> conn.request("POST", "/cgi-bin/query", params,
headers)
>>> response = conn.getresponse()
>>> print response.status, response.reason
200 OK
>>> data = response.read()
>>> conn.close()
================================================

But because of my limited knowledge in HTTP and
python, i still don't know how to do with a file
upload. Anybody can lend me a hand?
Thank you!

=====
Remote Scensing Satellite Ground Station
Chinese Academy of Science

_________________________________________________________
Do You Yahoo!? 
相见不如聊天!不出门一样面对面!网络摄像头对对派送中~赶快用你的雅虎电邮帐号参与吧……
http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com/