Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to fetch input stream pdf from URL Connection but I am getting the Empty input stream. Can anyone please tell me what is I am doing wrong? Following is the code:

<code>
                    URL fileUrl = new URL("https://www.dropbox.com/s/ao3up7xudju4qm0/Amalgabond%20Adhesive%20Agent.pdf");
                    HttpURLConnection connection = (HttpURLConnection)fileUrl.openConnection();
                    connection.connect(); 

                    InputStream is = connection.getInputStream();
                    Log.i("TAG", "is.available(): " + is.available());
</code>

is.available is returning 0 empty stream. Please help. Thanks

share
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.