views:

354

answers:

1

Hi there!

I am using http://pypi.python.org/pypi/mechanize/0.1.11 for programmatic web browsing, I want to be able to upload files to servers the same way the browser does (by sending the content as multipart/form-data, defined in RFC2388)

Is this possible with mechanize, can you show me an example?

Thanks!

+2  A: 

There's a couple of good answer on this SO question, one with bare mechanize and one with twill on top of it, and I believe they both end up sending multipart/form-data as you want.

Alex Martelli