You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
I want to download an image and convert its content into base64 string.
Here is what I did:
RNFetchBlob
.config({
fileCache : false,
appendExt : imageExtension,
})
.fetch('GET', this.props.imageUrl, {
//some headers ..
})
.then((res) => {
// here the data would be something like {-10: '', -25: null}
const data = res.base64();
})
curiously, sometime later, the data would be changed into something like {-10: '"", -25: "quite long base64 string"}. I guess something done in native thread and changed the data. Anyway , i cannot get the base64 string. Is there anything I am wrong ?
iOS11
RN 0.48
Thanks
The text was updated successfully, but these errors were encountered:
I changed the way and it works as expect. But it would be better if base64() works
let imagePath = null;
RNFetchBlob
.config({
fileCache : true,
appendExt : imageExtension,
})
.fetch('GET', this.props.imageUrl, {
//some headers ..
})
.then((res) => {
imagePath = res.path();
// changes to use readFile
return res.readFile('base64');
}).then((base64ImageData)=>{
// I can use the base64 data now
// just for removing template file in case
return RNFetchBlob.fs.unlink(imagePath);
})
I want to download an image and convert its content into base64 string.
Here is what I did:
RNFetchBlob
.config({
fileCache : false,
appendExt : imageExtension,
})
.fetch('GET', this.props.imageUrl, {
//some headers ..
})
.then((res) => {
// here the data would be something like {-10: '', -25: null}
const data = res.base64();
})
curiously, sometime later, the data would be changed into something like {-10: '"", -25: "quite long base64 string"}. I guess something done in native thread and changed the data. Anyway , i cannot get the base64 string. Is there anything I am wrong ?
iOS11
RN 0.48
Thanks
The text was updated successfully, but these errors were encountered: