react-native-fs icon indicating copy to clipboard operation
react-native-fs copied to clipboard

How to write file to assets

Open goalbased opened this issue 5 years ago • 5 comments

We have readFileAssets, but no writeFileAssets how can I write files to android assets folder or how the relative path between assets folder and DocumentDirectory?

Below is the problem I got in real word:

I have a index.html file in \android\app\src\main\assets for my webview component and in this html I include some CSS files like<link rel="stylesheet" type="text/css" href="./index.css" /> if I put those CSS files under the \android\app\src\main\assets then it works fine but now some CSS files will be download from API.

I can save them to DocumentDirectory folder but can't save them to assets folder so I can't include those CSS file, anything will be help. Thank you.

goalbased avatar Jul 16 '20 11:07 goalbased

We have readFileAssets, but no writeFileAssets how can I write files to android assets folder or how the relative path between assets folder and DocumentDirectory?

Below is the problem I got in real word:

I have a index.html file in \android\app\src\main\assets for my webview component and in this html I include some CSS files like<link rel="stylesheet" type="text/css" href="./index.css" /> if I put those CSS files under the \android\app\src\main\assets then it works fine but now some CSS files will be download from API.

I can save them to DocumentDirectory folder but can't save them to assets folder so I can't include those CSS file, anything will be help. Thank you.

Hi @goalbased Did you find any solution?

baharb avatar Aug 04 '21 15:08 baharb

I am also interested in doing this. Any luck?

curiousdustin avatar Oct 21 '21 23:10 curiousdustin

i'm also interested in doing this, please leave a comment if anyone did this.

scrapecoder avatar Jan 22 '22 08:01 scrapecoder

??? readFileAssets ???

massimilianochiodi avatar Nov 22 '23 12:11 massimilianochiodi