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
Contributor
Posts: 41
Registered: ‎11-08-2011
My Device: Blackberry Torch
My Carrier: ATT

Unknown HTTP Content-Length

We have an HTTP sever that will be serving files to a blackberry client.  But the file sizes are not known ahead of time.  If we set the content-length to -1 on the server side, the blackberry OS doesn't seem to like this.  It hangs... But when we set it to some really large number it works great (regardless of file size).  Is there a better way of telling the blackberry OS to ignore this content length for an unknown length file being streamed?  

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Unknown HTTP Content-Length

I was not aware that the BlackBerry OS used this value at all.

 

Have you tried not sending one.  In most http download code that I have seen, if there is no length returned, the code will just attempt to read everything, which I think would work find in your case.