[Tutor] Upload a file using python

Alan Gauld alan.gauld at btinternet.com
Sun Feb 16 16:17:52 CET 2014


On 16/02/14 09:15, rakesh sharma wrote:

> But I feel if i can use the http methods without involving any UI level
> automation things would be better.

To use http the server at the other end needs to know what you are 
trying to do. Given it already publishes an Ajax interface I'd have 
thought it was unlikely to also have a raw http interface for file uploads.

> file. I performed it using post method. But dint get the required result.
> The uploaded file dint appear in the site.

Does the server have a page that accepts post requests to upload files?
If not it won't recognize your post request and possibly just ignore
it or hopefully send you an http error back. Did you check the http 
error code returned?

HTH
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list