Not able to upload Zip file on server

Tries so many ways but couldn’t upload zip file on server. 

Please help me to sort it.

local url = "http://192.168.0.110/souqhero/Mobile/pos" local method = "POST" ------------------------------------------------------------------------------------ local function uploadListener( event )     if ( event.isError ) then                  print( "Network Error." )             else         if ( event.phase == "began" ) then             print( "Upload started" )         elseif ( event.phase == "progress" ) then             print( "Uploading... bytes transferred ", event.bytesTransferred )         elseif ( event.phase == "ended" ) then             print( "Upload ended..." )             print( "Status:", event.status )             print( "Response:", event.response )         end     end end ------------------------------------------------------------------------------------ local params = {     timeout = 60,     progress = true,     bodyType = "binary" } ------------------------------------------------------------------------------------ local baseDirectory = system.DocumentsDirectory local contentType = "application/zip"   ------------------------------------------------------------------------------------ local headers =  {     name = "newRequest.zip" } headers["Content-Type"]=contentType params.headers=headers network.upload( url , method, uploadListener, params, "newRequest.zip", baseDirectory, contentType )

network.upload() is using “PUT” not “POST” as how it transfers the file. Your receiving script needs to know how to handle this. If you need to use POST, then you will probably want to use network.request() instead and configure the header and body paramters in the options table correctly.  See:

https://coronalabs.com/blog/2014/02/25/tutorial-uploading-files-demystified/

Rob

network.upload() is using “PUT” not “POST” as how it transfers the file. Your receiving script needs to know how to handle this. If you need to use POST, then you will probably want to use network.request() instead and configure the header and body paramters in the options table correctly.  See:

https://coronalabs.com/blog/2014/02/25/tutorial-uploading-files-demystified/

Rob