Re: [Tutor] Upload a file using python

2014-02-17 Thread Mark Lawrence

On 17/02/2014 15:38, Alan Gauld wrote:


In that case you should be able to call the Ajax API directly using
urllib or cgi possibly some higher level Ajax module - I suspect one
will exist somewhere!



First port of call for such things https://pypi.python.org/pypi

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Upload a file using python

2014-02-17 Thread Alan Gauld

On 17/02/14 14:29, rakesh sharma wrote:

Greetings!!

Hi Alan,

The error code was that of success. 200.
Donno if the site supports a post method. It doesn't but is there any
other way of automating the process.
The issue of chrome 32 with selenium webdriver has stalled the show for me.
Hence i had to fend for some other ways.


OK I misunderstood your previous mail.
Its not that you don't want to use Ajax its that you don't
want to drive it via the browser UI?

In that case you should be able to call the Ajax API directly using 
urllib or cgi possibly some higher level Ajax module - I suspect one 
will exist somewhere!


But at this point we probably need to see some code to see how you are 
trying to do it.



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

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Upload a file using python

2014-02-17 Thread rakesh sharma
Greetings!!
Hi Alan,
The error code was that of success. 200.Donno if the site supports a post 
method. It doesn't but is there any other way of automating the process.The 
issue of chrome 32 with selenium webdriver has stalled the show for me. Hence i 
had to fend for some other ways.
thanks,rakesh

> To: tutor@python.org
> From: alan.ga...@btinternet.com
> Date: Sun, 16 Feb 2014 15:17:52 +0000
> Subject: Re: [Tutor] Upload a file using python
> 
> 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
> 
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
  ___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Upload a file using python

2014-02-16 Thread Alan Gauld

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

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor