Hi guys I was wondering how does one upload pics to a image hosting site programmatically through python or java (python preferred).
The site gives no ftp access just through a upload button on the site i.e only http access.
Now I don’t want any code here..I just cant figure out how to start out if u can guide me in the right direction it will be helpful.
<form method="post" name="" enctype="multipart/form-data" action="process.php" onsubmit="return validateForm(this)">
<input type="hidden" value="0" id="theValue">
<div id="myDiv">
<input type="file" name="imagefile[]" size="27"><br><br>
<input type="file" name="imagefile[]" size="27"><br><br>
<input type="file" name="imagefile[]" size="27"><br><br>
<input type="file" name="imagefile[]" size="27"><br><br>
<input type="file" name="imagefile[]" size="27"><br><br>
<input type="hidden" name="MAX_FILE_SIZE" value="2097152">
</div>
<p><a href="javascript:;" onclick="addElement();">Upload more</a></p>
<input type="submit" value="Upload" name="upload">
<p></p>
</form>
the web form.
*******************************
ATTENTION: This answer is outdated since the time it was written. Use requests library.
http://docs.python-requests.org/en/latest/
*******************************
This is a code sample that “just works” for me. It uses MultipartPostHandler for uploading files.
MultipartPostHandler is available at http://pypi.python.org/pypi/MultipartPostHandler/0.1.0