Skip to content

Commit f6672b0

Browse files
authored
Merge pull request #12 from iJimmyWei/master
Fix a bug with non image downloads for android download manager
2 parents 04c1e73 + dd077c7 commit f6672b0

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -777,11 +777,9 @@ public void onReceive(Context context, Intent intent) {
777777
return;
778778
}
779779
String contentUri = c.getString(c.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI));
780-
if ( contentUri != null &&
781-
options.addAndroidDownloads.hasKey("mime") &&
782-
options.addAndroidDownloads.getString("mime").contains("image")) {
780+
if ( contentUri != null ) {
783781
Uri uri = Uri.parse(contentUri);
784-
Cursor cursor = appCtx.getContentResolver().query(uri, new String[]{android.provider.MediaStore.Images.ImageColumns.DATA}, null, null, null);
782+
Cursor cursor = appCtx.getContentResolver().query(uri, new String[]{android.provider.MediaStore.Files.FileColumns.DATA}, null, null, null);
785783
// use default destination of DownloadManager
786784
if (cursor != null) {
787785
cursor.moveToFirst();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rn-fetch-blob",
3-
"version": "0.12.0",
3+
"version": "0.13.0",
44
"description": "A module provides upload, download, and files access API. Supports file stream read/write for process large files.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)