Continuing my previous post, upload file with relative path I tried to run using
url = '/mnt/sdcard/download/XYZ.txt';
File dir = Environment.getExternalStorageDirectory();
File f_path = new File(dir, url);
InputStream fis = null;
fis = new BufferedInputStream(new FileInputStream(f_path));
But is throwing me errors when I run this from my Android device.
java.io.FileNotFoundException: /mnt/sdcard/mnt/sdcard/download/XYZ.txt (No such file or directory)
The output of f_path is '/mnt/sdcard/download/XYZ.txt'
Where is the problem, and how to fix it? I can observe that it is adding mnt/sdcard to f_path.