Now the google drive api is deprecated , so i have integrated their new Drive REST API . In my app i want to show file picker to pick doc/images from google drive . I have used their sample : https://github.com/gsuitedevs/android-samples/blob/master/drive/deprecation/app/src/main/java/com/google/android/gms/drive/sample/driveapimigration/MainActivity.java
private void openFileFromFilePicker(Uri uri) {
if (mDriveServiceHelper != null) {
Log.d(TAG, "Opening " + uri.getPath());
mDriveServiceHelper.openFileUsingStorageAccessFramework(getContentResolver(), uri)
.addOnSuccessListener(nameAndContent -> {
String name = nameAndContent.first;
String content = nameAndContent.second;
mFileTitleEditText.setText(name);
mDocContentEditText.setText(content);
// Files opened through SAF cannot be modified.
setReadOnlyMode();
})
.addOnFailureListener(exception ->
Log.e(TAG, "Unable to open file from picker.", exception));
}
}
Now i want to upload that selected file on my server for that i would need a fileID, but in onActivityResult i can only access file name and content . So please help me and suggest me any solution . How can i upload selected resume file or image from google drive to my server .