1

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 is since I am uploading a huge video?

Andro Selva
  • 53,910
  • 52
  • 193
  • 240

3 Answers3

2

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.

Community
  • 1
  • 1
DArkO
  • 15,880
  • 12
  • 60
  • 88
  • Thanks, I will try this out and will post an comment on how it works. – Andro Selva Jun 20 '11 at 13:03
  • ye try it. just a note, you can actually find the mutipart/form upload process as a standard inside all the web apps on the internet for uploading files, so this is definitely a good way to go with larger files. – DArkO Jun 20 '11 at 13:09
0

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.

DarthJDG
  • 16,511
  • 11
  • 49
  • 56
advantej
  • 20,155
  • 4
  • 34
  • 39
0

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

wuwei
  • 1