开发者

Upload limit from android mobile to server

开发者 https://www.devze.com 2023-03-14 07:20 出处:网络
Hi I am trying to capture a video in my android mobile and upload it to a server. My current video size is 44mb and which crashes in the middle of the upload. But my other videos which are less in siz

Hi I am trying to capture a video in my android mobile and upload it to a server. My current video size is 44mb and which crashes in the middle of the upload. But my other videos which are less in size gets uploaded without any trouble.

So I just want to know,

  1. is there any upload limit in the mobile ? or

  2. The problem 开发者_C百科is since I am uploading a huge video?


You are probably running out of memory because the upload stream isn't uploaded by parts but instead the whole thing is stored until the upload is complete and then garbage collected. I have tried every available buffering solution but it isn't happening unless you use multipart.

If this is the error you are getting you will need to use multipart upload to get the whole thing uploaded. Search on google or stack on examples on how to do this. its not much different than using a http client, you will just need the http mime libraries from apache.

Here is a link that might help:

Multipart

Also apart from this limitation to not clearing the uploaded buffers until the upload is complete there is no limit to how much data you can transfer in a single request.


http upload may run into the 2gb limitation problem. Can use ftp upload instead.


is there any upload limit in the mobile ?

No, there isn't

The problem is since I am uploading a huge video?

Shouldn't be. However there may be problems with the way you are doing it. There could be 2 possible problems here (that I'm able to sense):

  1. You are performing the upload operation on the main thread (deadly sin !).
  2. With a long video you are experiencing a connectivity problem.

For any of these to detect, see what the logcat has to say ! Post the output here if you can.

0

精彩评论

暂无评论...
验证码 换一张
取 消