![]() I’ve attached the two base64 encoded image too. Tell network.request() that we want the "began" and "progress" events: params.progress = "download" print(multipart:toString()) network.request( "", "POST", uploadListener, params) This is my upload code, (with credits to Brill Pappin, Sixgreen Labs Inc) local MultipartFormData = require("class\_MultipartFormData") local multipart = MultipartFormData.new() multipart:addHeader("Authorization", "c4vFdAazaLMi5ivnIWB1XAA2RoIB0mbk1Aut6kgl") multipart:addField("start\_date","") multipart:addField("title","Really Good Title") multipart:addField("end\_date","") multipart:addField("original\_price","10") multipart:addField("duice\_price","5") multipart:addField("category","3") multipart:addField("description","Really good description") multipart:addFile("images", system.pathForFile( "uploadingImage.jpg", system.TemporaryDirectory ), "image/jpeg", "uploadingImage.jpg") multipart:addField("quantity","20") local params = params.body = multipart:getBody() - Must call getBody() first! params.headers = multipart:getHeaders() - Headers not valid until getBody() is called. Would any of the staffs or experts be able to offer me any advise on this? Yet at the same time i must do base64 encoding due to the multi-part form constraint. I would definitely need to store high quality image. This is a big problem for me as image quality are rising(instagram is using 640圆40 for their images) and 4k display is on the rise now. My problem is when i upload images of a higher resolution, i’ll encounter http error as it seems theres a maximum length to sending the base64 encoded image. My image within the post is encoded in base64 as corona doesnt allows uploading of multiple image with attributes in 1 “single post” unless they are base64 encoded(Please correct me if i’m wrong on this). To accomplish this i’m using multi-part form in corona. I’m trying to do an “instagram” similar post upload with picture,caption,etc in my app.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |