I'm working on uploading an mp3 file to a webhost (which i have no control over) and after a related question on StackOverflow, i noticed that the host does support Gzip encoded uploads.
In python, how would i be able to encode my stream (which i get from open(filename)) and send that to the server?
def upSong(fileName):
datagen, headers = multipart_encode({"mumuregularfile_0": open(fileName, "rb")})
uploadID = math.floor(random.random()*1000000)
request = urllib2.Request("http://upload0.mumuplayer.com:443/?browserID=" + browserID + "&browserUploadID=" + str(uploadID), datagen, headers)
urllib2.urlopen(request).read()
This is the code that does the uploading, being fairly new to python i have no idea how i would tackle a problem like this, but google have provided no answer.