瀏覽代碼

Set mime if set in addAndroidDownloads (#421)

Jon San Miguel 7 年之前
父節點
當前提交
8a75a9be2a
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3
    0
      android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+ 3
- 0
android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java 查看文件

@@ -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()) {