Hi!
My game takes a screenshot of the player’s decor and upload the photo to the server. Using Flash I did it like this:
var form:Multipart = new Multipart(upload_url);
form.addFile("file1", PNGEncoder.encode(bitmapData), "application/octet-stream", "test.jpg");
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete);
loader.load(form.request);
Now I’m trying to do it like this - but the server does not accept photo data:
-- here i'm using screenshot extension
local screenshot_png, w, h = screenshot.png()
http.request(upload_url, "POST", function(self, _, response)
pprint(response)
end, {["Content-Type"] = "application/octet-stream"}, "file1="..screenshot_png)
I think that I may be giving the wrong data …