filestack / filestack-android

Official Android SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
Apache License 2.0
156 stars 90 forks source link

Unable to get a google drive photo from the library #95

Closed sbatururimi closed 8 years ago

sbatururimi commented 8 years ago

When the Google drive app is allowed to get images from the camera we are able to see that google drive images in Gallery. device-2016-04-08-230616

The problem occurs in FilesUtils.java class

public static TypedFile getTypedFileFromUri(Context context, Uri uri) {
        String mimetype;
        if("content".equalsIgnoreCase(uri.getScheme())) {
...
File file = new File(path); // here the file will be nil, as the returned path being = null

The biggest problem resides in getPath. In

 if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {

there is no option for check against com.google.android.apps.docs and in this way null is returned, giving an error when retrieving a path to the file from the provided URI

sbatururimi commented 8 years ago

Any update?

ghost commented 8 years ago

Fixed the issue by merging pull request https://github.com/filestack/filepicker-android/pull/96. Thank you for your contribution.

Fix will be available in 3.10.0 release.