File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ registerNativeHandlers({
123123 } ,
124124 saveFile : async ( { fileName, fromUrl } ) => {
125125 try {
126- const path = FileSystem . documentDirectory + fileName ;
126+ const path = FileSystem . cacheDirectory + encodeURIComponent ( fileName ) ;
127127 const downloadedImage = await FileSystem . downloadAsync ( fromUrl , path ) ;
128128 return downloadedImage . uri ;
129129 } catch ( error ) {
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ registerNativeHandlers({
154154 } ,
155155 saveFile : async ( { fileName, fromUrl } ) => {
156156 try {
157- const path = RNFS . DocumentDirectoryPath + '/' + fileName ;
157+ const path = RNFS . CachesDirectoryPath + '/' + encodeURIComponent ( fileName ) ;
158158 await RNFS . downloadFile ( { fromUrl, toFile : path } ) . promise ;
159159 return 'file://' + path ;
160160 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments