Uploading a file via POST ?
Lars von Wedel
vonWedel at lfpt.rwth-aachen.de
Wed Mar 28 07:19:49 EST 2001
Hi,
You might want to try cgiupload:
http://starship.python.net/crew/jbauer/cgiupload/index.html
I'm using it for a similar purpose, see if it fits your needs...
Lars
Oliver Hofmann wrote:
>
> 'lo everyone!
>
> I am trying to write a small client in Python which submits a file
> to a webpage via the POST method. Part of the .html reads:
>
> ----
> <FORM METHOD=POST ENCTYPE=multipart/form-data
> ACTION="/cgi-bin/tst.pl_batch"
> onsubmit="return FSubmitValidation(this)">
>
> <INPUT TYPE=text SIZE=40 NAME=Email_Address>
> <INPUT TYPE=file NAME=UpLoad_File SIZE=50>
> ----
>
> I've taken a look at urllib.urlopen, however it seems to be limited
> more or less to GET requests. An optional data-argument must be
> in 'standard application/x-www-form-urlencoded format'; since the
> form requires multipart form-data this is probably not going to
> work.
>
> Is there an easy way to upload a file and pass parameters to the
> server script?
>
> Thanks a lot,
>
> Oliver
>
> --
> http://mail.python.org/mailman/listinfo/python-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vonWedel.vcf
Type: text/x-vcard
Size: 342 bytes
Desc: Card for Lars von Wedel
URL: <http://mail.python.org/pipermail/python-list/attachments/20010328/6edca8ba/attachment.vcf>
More information about the Python-list
mailing list