This repository was archived by the owner on Mar 16, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
src/android/src/main/java/com/RNFetchBlob Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public class RNFetchBlobConfig {
20
20
public long timeout = 60000 ;
21
21
public Boolean increment = false ;
22
22
public ReadableArray binaryContentTypes = null ;
23
- public Boolean largeFileUpload ;
23
+ public boolean largeFileUpload ;
24
24
25
25
RNFetchBlobConfig (ReadableMap options ) {
26
26
if (options == null )
Original file line number Diff line number Diff line change 4
4
import android .content .Intent ;
5
5
import android .net .Uri ;
6
6
import android .os .Bundle ;
7
+ import android .text .TextUtils ;
7
8
8
9
import com .facebook .react .modules .network .*;
9
10
@@ -78,17 +79,16 @@ protected void onHandleIntent(final Intent intent) {
78
79
: MediaType .parse ("application/octet-stream" );
79
80
if (filename != null && data .startsWith ("RNFetchBlob-" )) {
80
81
try {
81
- String newData = data .replace (RNFetchBlobConst .FILE_PREFIX , "" );
82
- String normalizedUri = RNFetchBlobFS .normalizePath (newData );
82
+ String normalizedUri = RNFetchBlobFS .normalizePath (data .replace (RNFetchBlobConst .FILE_PREFIX , "" ));
83
83
file = new File (String .valueOf (Uri .parse (normalizedUri )));
84
84
} catch (Exception e ) {
85
- //
85
+ file = null ;
86
86
}
87
87
}
88
88
89
89
String contentDisposition = "form-data"
90
- + (name != null && name . length () > 0 ? "; name=" + name : "" )
91
- + (filename != null && filename . length () > 0 ? "; filename=" + filename : "" );
90
+ + (! TextUtils . isEmpty ( name ) ? "; name=" + name : "" )
91
+ + (! TextUtils . isEmpty ( filename ) ? "; filename=" + filename : "" );
92
92
93
93
requestBuilder .addPart (
94
94
Headers .of ("Content-Disposition" , contentDisposition ),
You can’t perform that action at this time.
0 commit comments