Browse Source

Set mime if set in addAndroidDownloads (#421)

Jon San Miguel 7 years ago
parent
commit
8a75a9be2a
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+ 3
- 0
android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java View File

@@ -148,6 +148,9 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
148 148
                 if(options.addAndroidDownloads.hasKey("path")) {
149 149
                     req.setDestinationUri(Uri.parse("file://" + options.addAndroidDownloads.getString("path")));
150 150
                 }
151
+                if(options.addAndroidDownloads.hasKey("mime")) {
152
+                    req.setMimeType(options.addAndroidDownloads.getString("mime"));
153
+                }
151 154
                 // set headers
152 155
                 ReadableMapKeySetIterator it = headers.keySetIterator();
153 156
                 while (it.hasNextKey()) {