Android url connection getContentLength() returning negative value (-1) ?
SOLUTION
(ÇÖZÜM)
add this line
(Bu satırı ekle)
urlConnection.setRequestProperty("Accept-Encoding","identiy");
.
.
.
as it's shown below
(aşağıda gösterildiği gibi)
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestProperty("Accept-Encoding","identiy"); // <--- Add this
int length = urlConnection.getContentLength();
Hiç yorum yok:
Yorum Gönder