Hi All,
I have some code that saves a display object from the screen to the TemporaryDirectory - that’s working fine.
Reading the jpg back into the a variable - that’s working fine
useing mime.b64 to convert the above variable into a base64 variable - that’s working fine
Then I create a network request using the code below but it seems that the POST isn’t posting anything at all…any thoughts?
-- \_filename = specified above and is a valid filename. local \_file\_obj\_path = system.pathForFile(\_filename, system.TemporaryDirectory) local \_file\_obj = io.open(\_file\_obj\_path, rb) local \_file\_obj\_data = \_file\_obj:read("\*a") io.close(\_file\_obj) \_file\_obj=nil local \_file\_b64 = mime.b64(\_file\_obj\_data) local \_file\_obj\_size = string.len(\_file\_b64) -- post to CMS local p\_params = {} local headers = {} headers["Content-Type"] = "multipart/text" headers["Accept-Language"] = "en-US" p\_params.headers = headers p\_params.progress = "upload" p\_params.body = "hash="..string.urlEncode(hash).."&title="..string.urlEncode(text\_comments.text).."&user\_id=".. globalData.config\_table.user.id .. "&image\_name=" .. string.urlEncode(\_filename).."&image\_base64="..string.urlEncode(\_file\_b64) network.request("http://www.....com/index.php?user\_id=16", "POST", uploadListener, p\_params)
My Upload listener get the response from the PHP file, the $_GET[‘user_id’] is coming through fine but literally nothing in the $_POST at all.
Also tried multiple different Content-types and not including any headers - nothing makes a difference.
_file_obj_size is the size of the image( roughly of course as the base64 encoding adds a few characters here and there)
HELP!
Many thanks
Chris.