I am making an android app in which i am fetching images from server which are stored in mysql database.so i needed the file size before downloading and i am using this code
FileOutputStream fileOutput = new FileOutputStream(file);
InputStream inputStream = urlConnection.getInputStream();
int totalSize = urlConnection.getContentLength();
Seems the server is not setting
Content-Length in the response header.