Cgi File Upload without Form

Steve Holden steve at holdenweb.com
Sat Apr 28 14:27:36 EDT 2007


Karsten.G.Weinert at googlemail.com wrote:
> Hello,
> 
> what is the simplest way to upload a file (or a long string) to a
> server using cgi/python?
> 
> Since I want to upload the data programmatically, a form based
> solution is not good. I am not experienced with SOAP/WSDL and I
> believe that would be more difficult than necessary. The client
> program I have to use does not support FTP.
> 
A "form-based" solution is actually just what you want - you write a 
Python program that does just what the user's browser would do after 
they filled in a form.

You can do this with urllib fairly easily. If you get stuck then look 
for a library called mechanise.

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd           http://www.holdenweb.com
Skype: holdenweb      http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get Python in your .sig and on the web. Blog and lens
holdenweb.blogspot.com        squidoo.com/pythonology
tag items:            del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------



More information about the Python-list mailing list