Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 402
Registered: ‎11-26-2010
My Device: Torch

Transferring BIG files over HTTP using POST method

As emphasized in the title I need to transfer big files (for instance 20-30 mb video file data) from a blackberry to a server.

 

I read somewhere that HTTP POST request has a limit. 

Has someone tried to do this?

I saw an interesting idea here but I don't know if it is applicable in bb:

https://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib/trunk/qooxdoo-contrib/UploadJava...

 

Also if you managed to transfer bigger files using some other way please let me know, although I would strognly prefer http post if possible.

----------------------------------------------------------------------
Press the button to give kudos if I helped you Smiley Happy
Developer
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: Transferring BIG files over HTTP using POST method

Hi dx22,

 

Try using UDP connection.

 

E.

Developer
Posts: 402
Registered: ‎11-26-2010
My Device: Torch

Re: Transferring BIG files over HTTP using POST method

@maadani:
Unfortunately this won't work. UDP is not a reliable protocol. Datagrams are dropped/lost and you cannot guarantee that everything sent will be received. This will lead to receiving a corrupted file on the server side. I need to be able to send random files so I need a reliable protocol.
----------------------------------------------------------------------
Press the button to give kudos if I helped you Smiley Happy
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Transferring BIG files over HTTP using POST method

I would do two things:

 

a) Make sure you are only doing this over WiFi

b) I would send chunks to a Server process that could put the chunks back together. 

 

If you do this over WiFi you will not hit any limits, however WiFi is not 100% reliable and I don't think you want to restart the send if it fails on the last byte. 

Developer
Posts: 402
Registered: ‎11-26-2010
My Device: Torch

Re: Transferring BIG files over HTTP using POST method

thanks peter, that seems reasonable. If i send the file in pieces up to 1mb the server would assemble them back. If i do it this way, I will have to create some sort of protocol-like mechanism so the server can know how many pieces to expect, the number of the current package of the sequence etc.

I was thinking to make a multipart/form-data request but it is still a single request and as you said if it fails at the end we can't do anything.
----------------------------------------------------------------------
Press the button to give kudos if I helped you Smiley Happy
Highlighted
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Transferring BIG files over HTTP using POST method

You got it....

 

Just one thing - "If i send the file in pieces up to 1mb" - I would actually make the chunk smaller than that, but it is up to you.