Created
July 12, 2012 23:02
-
-
Save biswarupadhikari/3101702 to your computer and use it in GitHub Desktop.
Phonegap Content URI To File Path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String ActualFilePath=this.getRealPathFromURI(Uri.parse("content://media/external/images/media/8")); | |
private String getRealPathFromURI(Uri contentURI) { | |
Cursor cursor = this.cordova.getActivity().getContentResolver().query(contentURI, null, null, null, null); | |
cursor.moveToFirst(); | |
int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA); | |
return cursor.getString(idx); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment