Reputation: 55
Recently I have been working on an app and it requires the files on the phone to be uploaded to the server. These file may be either images or videos. I used ASyncTask to do the networking on the background.
However if the file size is greater than 45 MBs the file upload fails...it works just fine other-wise
What should I use instead of Async Tasks? Should I go for Sync Adapters or for the Volley library? I know nothing in either of these.
Upvotes: 2
Views: 5542
Reputation: 2285
What response do you get from the server when the upload fails? Understanding the response can help you get insight into why the upload is failing. One possibility is that the server you are trying to upload file to is not configured to handle that big payload in which case you will get the following HTTP response.
HTTP Error 413 Request entity too large
However this is just one of the possibilities. I suggest you to inspect HTTP response and it's other properties.
Upvotes: 0
Reputation: 1028
You can use retrofit typedfile approach to upload file in multi-part.
For your reference : https://futurestud.io/blog/retrofit-how-to-upload-files/
Upvotes: 1