Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue with non "image" mime types downloading with android download manager #623

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
Original file line number Diff line number Diff line change
Expand Up @@ -766,11 +766,9 @@ public void onReceive(Context context, Intent intent) {
return;
}
String contentUri = c.getString(c.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI));
if ( contentUri != null &&
options.addAndroidDownloads.hasKey("mime") &&
options.addAndroidDownloads.getString("mime").contains("image")) {
if ( contentUri != null ) {
Uri uri = Uri.parse(contentUri);
Cursor cursor = appCtx.getContentResolver().query(uri, new String[]{android.provider.MediaStore.Images.ImageColumns.DATA}, null, null, null);
Cursor cursor = appCtx.getContentResolver().query(uri, new String[]{android.provider.MediaStore.Files.FileColumns.DATA}, null, null, null);
// use default destination of DownloadManager
if (cursor != null) {
cursor.moveToFirst();
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rn-fetch-blob",
"version": "0.12.0",
"name": "rn-fetch-blob-v2",
"version": "0.14.1",
"description": "A module provides upload, download, and files access API. Supports file stream read/write for process large files.",
"main": "index.js",
"scripts": {
Expand All @@ -22,7 +22,7 @@
"image header"
],
"repository": {
"url": "https://github.com/joltup/rn-fetch-blob.git"
"url": "https://github.com/iJimmyWei/rn-fetch-blob"
},
"author": "Joltup",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion rn-fetch-blob.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require "json"
package = JSON.parse(File.read('package.json'))

Pod::Spec.new do |s|
s.name = package['name']
s.name = 'rn-fetch-blob'
s.version = package['version']
s.summary = package['description']
s.requires_arc = true
Expand Down