Please provide the following:
- SDK Version: 44.0.0
- Platforms(Android/iOS/web/all): all
- Add the appropriate “Tag” based on what Expo library you have a question on. FileSystem
Good morning guys,
I have been using downloadResumable.downloadAsync() for some time now, and it has been working fine. All of a sudden the app users started complaining about downloads not working.
So I checked the code and the same error occurred.
Currently, I can download the same file with FileSystem.downloadAsync, but the same file doesn’t download with downloadResumable.downloadAsync.
downloadResumable comes back with this error file:
Bad RequestBad Request - Invalid Header
HTTP Error 400. The request has an invalid header name.
The challenge s now is that with FileSystem.downloadAsync, I can’t see the progress of the file download, while I can see it with downloadResumable. Please what can I do.
Please check the link to the file below:
https://www.wabpreader.com.ng/images/compressed/BASIC SCIENCE and TECHNOLOGY BOOK 2 - U.M.O. Ivo Ayodele; T.C. Ogbuanya; I.T. Landu; David Omole.txt
downloadResumable code below:
const downloadResumable = FileSystem.createDownloadResumable(
fileLink,
FileSystem.documentDirectory + ebookPath + ".txt",
{
headers: {
"Content-Type": "*/*",
},
},
callback
);
await downloadResumable
.downloadAsync()
.then(({ uri }) => {
console.log("Finished downloading to ", uri);
this._checkFile(ebookPath, title);
})
.catch((error) => {
console.error(error);
});
FileSystem.downloadAsync code below:
const { uri } = await FileSystem.downloadAsync(
fileLink,
FileSystem.documentDirectory + ebookPath + ".txt"
)
.then(({ uri }) => {
console.log("Finished downloading to ", uri);
this.viewFile(uri, title);
})
.catch((error) => {
console.error(error);
});
Thanks
Tim