Copy link to clipboard
Copied
I just came across an odd 'limit' on file upload. My server is set to receive files up to 100GB. Using the same client code, and the same server side code, on a Mac or Win running Air 22 I am able to upload files 30,40,50, ... GB. On Android, I seem to be able to upload 7,454 kb or 7,469 kb of the file, and it stops (if the file is smaller, it works, if larger it stops at one of these sizes every time). I am using file.upload(uploadURL) - same url works for Mac/Win. Is there some sort of limit on the upload size of files on the Android?
Copy link to clipboard
Copied
I have tried several configurations on the Android, but I still get the maximum file size uploaded to be 7,469 kb. Is this a limitation on Air 22, on Android, on file.upload, or should I use a different method to upload?
Copy link to clipboard
Copied
Hello,
Thanks for reporting the issue, I tried this by making simple project and its working fine so Could you please share a sample project so that it will be helpful for us reproduce at our end ? and is it working fine for you using AIR 21 ?
Regards,
Mayank
Copy link to clipboard
Copied
The code follows the following:
var vPath:String = "pathToFileOnAndroid";
var fileUpload:File = new File(vpath);
var uploadURL:URLRequest = new URLRequest();
var uploadParams:URLVariables = new URLVariables();
uploadParams.type = 'file';
uploadURL.method = URLRequestMethod.POST;
uploadURL.data = uploadParams;
uploadURL.url = "https://www.yourdomain.com/​" + "uploadfile.php";
fileUpload.addEventListener( Event.COMPLETE, uploadComplete );
fileUpload.addEventListener( IOErrorEvent.IO_ERROR, fileuploadioError );
fileUpload.addEventListener( ProgressEvent.PROGRESS, progressHandler );
fileUpload.upload( uploadURL );
-----
the upload begins, can see it on the server in the php temp uploads directory, and it stops at 7,469 KB on the server. The progressHandler updates the local progressBar on the Android device, and stops at approx. the correct position of 7.4/total file size (ie. progress seems to be reporting correctly). After a while, the fileuploadIoError is triggered. Test files under 7 MB transfer ok, all over 7.5MB fail in this way. Note that on the backend, using the same url and php and server, uploads from Win and Mac succeed at 100 MB and more.
Copy link to clipboard
Copied
I have been experimenting with various configurations and have discovered the following, all using Air 22:
- when I upload using the method above, and the upload url is https, on an Android device the upload stops at 7,469 KB
- when I upload using the method above, and the upload url is http, on an Android device the upload succeeds
- when I upload using the method above, and the upload url is https or http, on an iOS/Mac/Windows device the upload succeeds
All using the same physical server, same upload.php, same AS code.
I am not certain why this would happen only with https on Android on file upload sizes of over 7.5MB? I have also heard that other coders are experiencing some issues related to tls/ssl/https/rtmps on Android with Air 22 - was there some changes to the security handling on Android Air 22 that may be causing this?
Thanks.
Copy link to clipboard
Copied
Is it specific to any android version like N/M or facing on every android device ?
-Mayank
Copy link to clipboard
Copied
Have tried on Android 4 and Android 6 devices - same results.