繁体   English   中英

在 react-native 中将原始文件转换为实际文件

[英]Converting raw file into actual file in react-native

我有一个从服务器获取的原始文件,例如:

file: {
fileName:xyz,
size:7125,
mimeType:document/pdf
}

我如何将其转换为普通文件并将其保存到受尊重的目录中。 谢谢你。

您已下载该文件并将其存储在您的手机 memory 中,对于下载,您有以下选项。

  1. 使用那个库。

    https://github.com/joltup/rn-fetch-blob#download-to-storage-directly

  2. 在浏览器中打开该链接browser and download it through the browser

    https://reactnative.dev/docs/linking#openurl

  3. 如果您使用的是expo您可以这样做

    https://docs.expo.io/versions/latest/sdk/filesystem/#example-usage

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM