Posting files like image with other params

Hi!

Would like to enquire of the staffs and corona experts if it’s possible to post file and with other params?

What i’m trying to do is upload an image along with other attribute parameters such as user name,email,etc.

Here’s my uploading code

-- Specify what file to upload and where to upload it from. -- Also, set the MIME type of the file so that the server knows what to expect. local photo = "uploadingImage.jpg" local baseDirectory = system.TemporaryDirectory local contentType = "application/x-www-form-urlencoded"  --another option is "text/plain" local headers = {       ["Content-Type"] =   "application/x-www-form-urlencoded",          ["Content-Length"] =len,  ["Authorization"] = myData.box.accessToken  ,  ["filetype"] = "jpg"  } params.headers = headers network.upload( url , method, uploadListener, params, photo, baseDirectory, contentType )

If possible would greatly appreciate if can show an example/sample code to demonstrate that. Thanks!

Regards,

Vincent

Yes, you can post multipart messages with HTTP, for example a part containing URLencoded text and a part containing a jpeg image.

You can read up on multipart messages here: http://stackoverflow.com/questions/16958448/what-is-http-multipart-request

Thanks memo!

I’ll try that out!

Yes, you can post multipart messages with HTTP, for example a part containing URLencoded text and a part containing a jpeg image.

You can read up on multipart messages here: http://stackoverflow.com/questions/16958448/what-is-http-multipart-request

Thanks memo!

I’ll try that out!