see changelog (v1.4.1)

* Better handling on Android of buggy file managers that return no intent when canceling the file selection even though it returns Activity.RESULT_OK (#111)

* removes deprecated Android SDK code and fixes an issue that could prevent some downloaded files from being picked

* adds getMultiFile and prevents UI blocking when picking large remote files

* updates readme file

* fixes an issue that could prevent internal storage files from being properly picked

* fixes #126
This commit is contained in:
Miguel Ruivo 2019-09-17 10:15:05 +01:00
parent 02b11efd14
commit b4524e3ee9
3 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,7 @@
## 1.4.1
**Bug fix:** Fixes an issue that could result in some cached files, picked from Google Photos (remote file), to have the name set as `null`.
## 1.4.0+1
**Bug fix:** Fixes an issue that could prevent internal storage files from being properly picked.

View File

@ -16,6 +16,7 @@ import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Random;
import io.flutter.plugin.common.MethodChannel;
@ -108,7 +109,7 @@ public class FileUtils {
return getDataColumn(context, contentUri, selection, selectionArgs);
}
} else if ("content".equalsIgnoreCase(uri.getScheme())) {
Log.e(TAG, "NO DOCUMENT URI - CONTENT");
Log.e(TAG, "NO DOCUMENT URI - CONTENT: " + uri.getPath());
if (isGooglePhotosUri(uri)) {
return uri.getLastPathSegment();
} else if (isDropBoxUri(uri)) {
@ -116,7 +117,7 @@ public class FileUtils {
}
return getDataColumn(context, uri, null, null);
} else if ("file".equalsIgnoreCase(uri.getScheme())) {
Log.e(TAG, "No DOCUMENT URI - FILE");
Log.e(TAG, "No DOCUMENT URI - FILE: " + uri.getPath());
return uri.getPath();
}
return null;
@ -182,7 +183,8 @@ public class FileUtils {
Log.i(TAG, "Caching file from remote/external URI");
FileOutputStream fos = null;
String externalFile = context.getCacheDir().getAbsolutePath() + "/" + FileUtils.getFileName(uri, context);
final String fileName = FileUtils.getFileName(uri, context);
String externalFile = context.getCacheDir().getAbsolutePath() + "/" + (fileName != null ? fileName : new Random().nextInt(100000));
try {
fos = new FileOutputStream(externalFile);

View File

@ -1,8 +1,8 @@
name: file_picker
description: A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extensions filtering support.
description: A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extension filtering support.
author: Miguel Ruivo <miguel@miguelruivo.com>
homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker
version: 1.4.0+1
version: 1.4.1
dependencies:
flutter: