use*_*290 5 pdf storage react-native react-native-fs
是否可以在文档或下载中使用react-native保存文件?我正在尝试使用react-native-fs保存pdf文件:
let file = await RNHTMLtoPDF.convert(options)
const destinationPath = RNFS.DocumentDirectoryPath + "/" + fileName + ".pdf"
RNFS.copyFile(file.filePath, destinationPath)
Run Code Online (Sandbox Code Playgroud)
但它保存在根目录(/data/user /0/com.prodhealth.mobile.Dev/files/TestTest_2022-02-22_2022-02-22.pdf )中,普通用户无法访问。
有没有办法直接将其保存在手机内部存储的文档/下载中?我需要该用户可以轻松访问该文件。
dirs
该常量是包含常用文件夹的哈希映射:
例子
RNFetchBlob.fs.cp(SRC_PATH, DEST_PATH)
.then(() => { ... })
.catch(() => { ... })
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
9448 次 |
最近记录: |