Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 如何将React本机Fetch Blob Blob转换为base64/Image_React Native_React Native Fetch Blob - Fatal编程技术网

React native 如何将React本机Fetch Blob Blob转换为base64/Image

React native 如何将React本机Fetch Blob Blob转换为base64/Image,react-native,react-native-fetch-blob,React Native,React Native Fetch Blob,我正在尝试使用React Native Fetch Blob将图像存储在Firebase.Storage中,我终于在存储中获得了一些内容,但存储中的文件现在是完全无意义的/压缩数据,我无法真正用于任何用途 如何将blob转换回BASE64或image,以便在应用程序中使用该映像 ` ` 代码基于此项目下面的代码将URL转换为base64图像 RNFetchBlob.fetch("GET", "ImageURL").then(resp => { base64image.push(

我正在尝试使用React Native Fetch Blob将图像存储在Firebase.Storage中,我终于在存储中获得了一些内容,但存储中的文件现在是完全无意义的/压缩数据,我无法真正用于任何用途

如何将blob转换回BASE64或image,以便在应用程序中使用该映像

`

`


代码基于此项目

下面的代码将URL转换为base64图像

   RNFetchBlob.fetch("GET", "ImageURL").then(resp => {
   base64image.push("data:image/png;base64," + resp.data);              
        console.log(base64image);   // -> your base64 image       
   });
   RNFetchBlob.fetch("GET", "ImageURL").then(resp => {
   base64image.push("data:image/png;base64," + resp.data);              
        console.log(base64image);   // -> your base64 image       
   });