Grokbase Groups Python tutor May 2011
FAQ
I am trying to upload a xml file via pycurl, I really need some help here.



url = "https://192.168.0.68/fileupload/upload_file.php"



binaryptr = open('activation.xml','rb').read()

head = ['Content-type:text/xml']

c.setopt(c.SSL_VERIFYPEER, 0)

c.setopt(c.SSL_VERIFYHOST, 0)

c.setopt(c.POSTFIELDS,binaryptr)

c.setopt(c.POSTFIELDSIZE,23L)

c.setopt(c.HTTPHEADER,head)

c.setopt(c.URL, url)

c.setopt(c.VERBOSE, 1)

c.perform()



Regards Rayon



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110516/5899a414/attachment.html>

Search Discussions

  • Brett Ritter at May 16, 2011 at 6:25 pm

    On Mon, May 16, 2011 at 2:00 PM, Rayon wrote:
    I am trying to upload a xml file via pycurl, I really need some help here.
    What is the error your are receiving? Did you fix the fact that you
    had starting whitespace as I mentioned to your last email?

    --
    Brett Ritter / SwiftOne
    swiftone at swiftone.org
  • Alan Gauld at May 16, 2011 at 10:02 pm
    "Rayon" <evosweet at hotmail.com> wrote
    I am trying to upload a xml file via pycurl, I really need some help
    here.
    So give us a clue.
    What is wrong with your code? And what does the real code
    look like, the fragment you have posted doesn't tell us too
    much - what is c? what have you imported, and how did you do it?

    Are you getting an error - if so what does it say?
    Are you getting bad data out? If so what did you get?
    What did you expect?

    "I really need some help" doesn't tell us much.


    --
    Alan Gauld
    Author of the Learn to Program web site
    http://www.alan-g.me.uk/
    url = "https://192.168.0.68/fileupload/upload_file.php"
    binaryptr = open('activation.xml','rb').read()
    head = ['Content-type:text/xml']

    c.setopt(c.SSL_VERIFYPEER, 0)
    c.setopt(c.SSL_VERIFYHOST, 0)
    c.setopt(c.POSTFIELDS,binaryptr)
    c.setopt(c.POSTFIELDSIZE,23L)
    c.setopt(c.HTTPHEADER,head)
    c.setopt(c.URL, url)
    c.setopt(c.VERBOSE, 1)
    c.perform()

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouptutor @
categoriespython
postedMay 16, '11 at 6:00p
activeMay 16, '11 at 10:02p
posts3
users3
websitepython.org

3 users in discussion

Alan Gauld: 1 post Brett Ritter: 1 post Rayon: 1 post

People

Translate

site design / logo © 2022 Grokbase