Source

wd_pys60 / wd_photouploader.py

url="http://i.i.gongda.tk/image/new" 

import camera, httplib

PHOTO = u"e:\\Images\\photo_upload.jpg"

def photo():
    photo = camera.take_photo()
    photo.save(PHOTO)
     
def upload():
    image = file(PHOTO).read()
    conn = httplib.HTTPConnection("i.i.gongda.tk")
    conn.request("POST", "/image/new", image)
    conn.close()

photo()
print "photo taken"
upload()
print "uploading done"