Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 28476

Downloading large number of files using Expo.Filesystem.downloadAsync sometimes stuck indefinitely

$
0
0

Im using Expo.Filesystem.downloadAsync to download large no. of files like images & videos. But it sometimes stuck indefinitely at some point. Im tying to download files inside a loop. The code is :

        let image_downloading = section.map(async (item, i) => {
            item.image !== null  ?
                await FileSystem.downloadAsync(item.image,
                    directory + item.image.split("/").reverse()[0]
                )
                    .then(({ uri }) => {
                        item['image'] = uri;
                        console.log('Finished downloading section to ', uri);
                    })
                    .catch(({error}) => {
                        console.log('errorrrrrrrrrrrrr',error)
                    })
                : null
    });
    await Promise.all(image_downloading);

Also i've tried using FileSystem.createDownloadResumable. When using createDownloadResumable the downloading is getting very slow


Viewing all articles
Browse latest Browse all 28476

Trending Articles