tags:

views:

79

answers:

1

Hi There, Can anybody tell me how to get the size of a file before downloading it from server(may be http,ftp or anything) in android?.Does streaming works?. Please Help me..

Regards Varnesh

+2  A: 

If you are using the built-in Apahce HTTP library to make a request for a file, you can get the file size by requesting the headers only. Inside the headers will be a "content-length" attribute that will indicate the number of bytes of the requested file. Requesting the headers will not request the file itself.

Chris Thompson