How do i store images/files

Hi there,

I’ve been using React Native Fetch Blob for downloading images and storing them to be used throughout my app, i’ve since moved to and tried to use it on Expo but i get errors like RNFetchBlob.DocumentDir is undefined and etc.

Then i tried using React Native FS which also produces the same sort of error

Which library or how do i store images/files with expo?

1 Like

I’d recommend taking a look at the Asset docs, specifically Asset.downloadAsync. Let us know if that doesn’t work for you?

alright i’ll try that out, thanks

Are there examples of how to use it?
No idea where to put the URL

import Expo from ‘expo’


This was how i was doing it before

let imageLocation = roomImageDir+'roomImg-'+roomId;

	.then((isDir) => {
		if(isDir === false) {
			.catch((err) => {
				// do nothing
				// console.log(err)

	return (dispatch) => {

		.then((exists) => {
			if (exists)
				pImage = 'file://' + imageLocation
				return RNFetchBlob.config({
						appendExt: 'jpg',
				.fetch('GET', 'https://theapiurl/getimage/'+roomId)
				.then((res) => { 

					let pImage = ''
					if( {
						RNFetchBlob.fs.writeFile(imageLocation,, 'base64')	
						pImage = 'file://' + imageLocation

Well just to reply myself, i just did a Image.prefetch instead thinking i dont really need to specify where i save the image

let imageURL = ''+roomId
return (dispatch) => {
        .then( () => {

I have same question regarding downloading but for video… i have videos each with size of more than 5MB so before play i want to download those videos to local storage so definitly i want to show some progress bar to users. as we can;t integrate RNFS or RNFETCHBLOB with expo… question is can we get progress of downloading with expo assets way?

Try this one!! It works with expo@v25 and I’m using it in my project.

Hi everyone.
I have a question in using
According to above doc, have to set native setting but in expo can’t set native setting.
How can use rn-fech-blob module in expo?
Thanks in advance

you don’t need to use that library. see

Hi @notbrent.
Thanks for your reply. I am going to save image from image picker.
I used downloadAsync function like as follow:

const image = await ImagePicker.launchCameraAsync({
  allowsEditing: true,
  aspect: [16, 9],
  quality: 1,

let localUri = image.uri;
let localUriNamePart = localUri.split('/');
const fileName = localUriNamePart[localUriNamePart.length - 1];

await FileSystem.downloadAsync(image.uri, dir_path + "/" + fileName)
.then(({ uri }) => {
    console.log('Finished downloading to ', uri);
.catch(error => {

Take picture from camera and save it to local. It works on ios well but on android there is an error. It says only provide http:// or http:// as a url on android. I add the error screen.
How to save image file from image picker?
Thanks for your advance.

hey there! you could use copyAsync instead of download because the file will already be on your local filesystem but in a temporary directory

1 Like

Thanks for your help. You saved my time.
Thank you very much. :+1:

Could you advance me for my other issue?