mayank mayank - 1 year ago 119
Android Question

Android file path error

I choose an image from galley and I get the path as:


and the image gets loaded as bitmap. However when I pass the image path in volleyplus multipart request for uploading, I get file not found exception. However, when I give the path as:


then everything works fine. How do I get the image path in this format.

Answer Source

You can use substring method to delete file:// part of your path or

use this method to get real path :

Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + "YourFileName"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download