html POST in python

Mark Light light at soton.ac.uk
Mon Jun 28 16:17:42 CEST 2004


Hi I am trying to "post" a file to a webpage and save the output as a
file. I have looked at
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306

which seems to have several suggestions - my problem is my lack of
knowledge of html forms.

The active part of the webpage form in question is below - how would I
feed this information into one of the python scripts from the cookbook
examples. Also would I need to do something about handling the result?

I have a plain text file in a location say "c:\temp\file.cif"

""""

<form method="post" enctype="multipart/form-data"
action="http://scripts.iucr.org/cgi-bin/checkcif.pl">File name:<br />
<input type="file" name="file" size="35">
<input type="submit" name="UPLOAD" value="Send"> <br />
<br />

</form>


""""


Any advei would be very useful to me.

Mark.




More information about the Python-list mailing list