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

Fix Android file saving bug #184

Merged
merged 1 commit into from
Nov 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public RNFetchBlobFileResp(ReactApplicationContext ctx, String taskId, ResponseB
path = path.replace("?append=true", "");
mPath = path;
File f = new File(path);

File parent = f.getParentFile();
if(!parent.exists() && !parent.mkdirs()){
throw new IllegalStateException("Couldn't create dir: " + parent);
}

if(f.exists() == false)
f.createNewFile();
ofStream = new FileOutputStream(new File(path), appendToExistingFile);
Expand Down