I try to POST QPixmap image bia http. To do that, I have to let QPixmap save to temporary file and read it as python file class, do POST works. But I think that there is another way to POST QPixmap. Guess it, QPixmap save to StringIO(or something else) and with it I can do POST.
Currently I wrote like that.
from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
import urllib2, os
tmpIm = "c:/tmpIm.png"
PIXMAP.save(tmpIm, "PNG")
register_openers()
_f = open(tmpIm, "rb")
datagen, headers = multipart_encode({"image": _f})
request = urllib2.Request(UPLOAD_URL, datagen, headers)
_rnt = urllib2.urlopen(request)
_f.close()
os.remove(tmpIm)