Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6100399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:22:55+00:00 2026-05-23T13:22:55+00:00

I’m working on application which has workflow like this: 1.parsing home page (using HttpURLConnection,

  • 0

I’m working on application which has workflow like this:

1.parsing home page (using HttpURLConnection, connect(), do stuff, disconnect(), use data),

2.after click on links I made, parsing article or download file based on link.

First step works perfect & 2nd too in case of article, but when I’m trying to download file from specific url and save it to SD card, I got fileNotFoundException in this line:

  InputStream inputStream = urlConnection.getInputStream();

My guide for doing it (downloading file) was code explained here http://goo.gl/GTBOP and I set permissions in manifest as required for this action, plus before any download operation I checked MEDIA_MOUNTED & MEDIA_MOUNTED_READ_ONLY state and it seems like that fits nice.

So..I read a lot about this problem on stackOverflow and other places and I tried different suggestions like adding these:

urlConnection.setRequestProperty("User-Agent","Mozilla/5.0 ( compatible ) ");
urlConnection.setRequestProperty("Accept","*/*");

or

System.setProperty("http.keepAlive", "false");

but with no success. I’m still stucked with fileNotFoundException. I tried to catch response code from webpage and it says 404.. ?!

It’s strange that if I hardcode link to file for downloading from any other site it downloads file without any troubles. So to make it clear I pickup clicked link to fileurl variable but in a next step I just say fileurl=”somesite/somefile.ext” everything goes smooth.. From web browser I can download any file that make troubles in my application so I’m confused where is the problem..

Any suggestion please..? 10q

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:22:56+00:00Added an answer on May 23, 2026 at 1:22 pm

    Oki.. after so much time no answer to this.. 🙁 Finally I found solution on my own so I’m posting here cause somebody will hopefully find use of it..

    in URL i noticed a lot %20 so before I used it I encode it with URI.encode(fileURL)
    as it described on android dev pages

    and voila.. everything was ok.. 🙂 Thanks everybody for contributing community! 😉 Cheers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I want to count how many characters a certain string has in PHP, but
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.