Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit c6e49fb

Browse files
committed
Merge branch '0.10.1' of github.com:wkh237/react-native-fetch-blob into 0.10.1
2 parents 8c132ed + 4d95709 commit c6e49fb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/android/src/main/java/com/RNFetchBlob/Response/RNFetchBlobFileResp.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public RNFetchBlobFileResp(ReactApplicationContext ctx, String taskId, ResponseB
4646
path = path.replace("?append=true", "");
4747
mPath = path;
4848
File f = new File(path);
49+
50+
File parent = f.getParentFile();
51+
if(!parent.exists() && !parent.mkdirs()){
52+
throw new IllegalStateException("Couldn't create dir: " + parent);
53+
}
54+
4955
if(f.exists() == false)
5056
f.createNewFile();
5157
ofStream = new FileOutputStream(new File(path), appendToExistingFile);

0 commit comments

Comments
 (0)