"Hank Hu" <> writes:
> I'm writing a prototype with python and need upload a zip file to a web
> server. Any idea?
http://wwwsearch.sourceforge.net/ClientForm/
At your own risk, since file upload is poorly tested ATM. You'd need
this version:
http://wwwsearch.sourceforge.net/Cli...-0.1.3a.tar.gz
IIRC, there's not yet a method on HTMLForm, so you need to use the
control directly:
import urllib2
from ClientForm import ParseResponse
forms = ParseResponse(urllib2.urlopen("http://www.example.com/"))
form = forms[0]
ctrl = form.find_control(type="file")
# note multi-file upload not implemented yet
# name and content_type args. to add_file are optional
ctrl.add_file(open("my.zip"), name="my.zip")
response2 = urllib.urlopen(form.click())
John