Android getting FileNotFound Exception, even if file exists
<p>As the title suggests I am getting <code>"FileNotFoundException"</code> even if image exists in SDCard, and even with all my efforts I am not able to find any reason for it. I have the permission in manifest for writing on external storage. Also this occurs for only certain images, so it's quite complicating the issue.</p>

<p><br><br>
The path of the image is:  /mnt/sdcard/projFolder/1090901/-23686809809<br>
Following is the code to download image :<br><br></p>

<pre><code>    URL Url = new URL(url);
    URLConnection urlConn = Url.openConnection(); 

if(!enoughSpaceLeft(urlConn.getContentLength())){

       onError(NoSpaceError);
     break;
}

    InputStream is = Url.openStream();
    OutputStream os = new FileOutputStream(file);
    byte[] b = new byte[1024];
    int length;

    while ((length = is.read(b)) != -1)
        os.write(b, 0, length);

    os.close();
    is.close();
</code></pre>

<p><br>
I am attaching the image that is creating problem , it's actually a QR code</p>

<p><img src="http://i.stack.imgur.com/x7y3Z.png"></p>
