Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save biswarupadhikari/3101702 to your computer and use it in GitHub Desktop.
Save biswarupadhikari/3101702 to your computer and use it in GitHub Desktop.
Phonegap Content URI To File Path
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