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

Im using Expo.Filesystem.downloadAsync to download a 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

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.