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 {
2020 public long timeout = 60000 ;
2121 public Boolean increment = false ;
2222 public ReadableArray binaryContentTypes = null ;
23- public Boolean largeFileUpload ;
23+ public boolean largeFileUpload ;
2424
2525 RNFetchBlobConfig (ReadableMap options ) {
2626 if (options == null )
Original file line number Diff line number Diff line change 44import android .content .Intent ;
55import android .net .Uri ;
66import android .os .Bundle ;
7+ import android .text .TextUtils ;
78
89import com .facebook .react .modules .network .*;
910
@@ -78,17 +79,16 @@ protected void onHandleIntent(final Intent intent) {
7879 : MediaType .parse ("application/octet-stream" );
7980 if (filename != null && data .startsWith ("RNFetchBlob-" )) {
8081 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 , "" ));
8383 file = new File (String .valueOf (Uri .parse (normalizedUri )));
8484 } catch (Exception e ) {
85- //
85+ file = null ;
8686 }
8787 }
8888
8989 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 : "" );
9292
9393 requestBuilder .addPart (
9494 Headers .of ("Content-Disposition" , contentDisposition ),
You can’t perform that action at this time.
0 commit comments