Hi
I have trouble with an uploading code. The idea is to upload a screen capture on to a server using the network.upload()
So i set-up already the php server to handle PUT request and everything it works fine. I can received the file from iOS.
On android it’s tricky:
For the the following device it works.
Galaxy Ace 3 – GT-S7270 - 480 x 800 - 4 inch - Android 4.2
Galaxy Tab 3 - GTP5200 - 1280x800 - 10 inch - Android 4.2.2
On this one it does not work:
Galaxy Note II – GT 7100 - 720 x 1280 - 5.5 inch - Android 4.3
Galaxy Nexus 19250XXLJ1 - 720 x 1280 - 4.65 inch - Android 4.3
Guess there’s a problem with android version 4.3
Here is the code:
local url = "http://www.sompom.com/apple/put.php/"..filenameImage local method = "PUT" -- Set some reasonable parameters for the upload process: local params = { timeout = 60, progress = true, bodyType = "binary" } local filename = filenameImage print(filename) local baseDirectory = system.CachesDirectory local contentType = "image/png" --another option is "text/plain" local headers = {} headers.filename = filename params.headers = headers network.upload( url , method, uploadListener, params, filename, baseDirectory, contentType )
And for the permissions:
“android.permission.READ_EXTERNAL_STORAGE”,
“android.permission.WRITE_EXTERNAL_STORAGE”,
“android.permission.ACCESS_ALL_EXTERNAL_STORAGE”,
“android.permission.INTERNET”,
“com.android.vending.BILLING”
Anybody got idea/feedback experience/psychological support (and/or) to bypass the issue?