Open FrankieJLyons opened 3 years ago
Hi @FrankieJLyons . Were you able to resolve the issue ?
I was facing a similar problem, and the addandroidDownloads
was the root of my problem. After some tests I changed my rn-fetch-blob's config param to work this way:
...
const { path } = await RNFetchBlob.config({
fileCache: true,
path: filePath, // the path where you want to store your file
appendExt: file.ext // the file extension. e.g: csv, pdf, jpg...
}).fetch('GET', file.path);
...
After that, you can call path() to access the downloaded file.
Hope some of this can help you! 😉
RN Version: 0.63.4 RNFB Version: ^0.12.0 Android version: Multiple, is happening on many devices and mac emulator Dev Machine: 2019 MacBook Pro running 11.4
Hello, i have a messaging system in my app where users can send a message with files to each other.
On iOS, this is working perfectly. However, on android, it appears PDF files only work sometimes, and are possibly being corrupted somewhere in my android specific code, as the same files open without issue on iOS devices and the simulator.
I did believe that this code was totally broken and unable to open PDF's, however one PDF did open completely randomly, I suspect file size may have something to do with it?
Whenever I try to open or preview the PDF, android tells me: 'Cannot display PDF (filename.pdf is of invalid format)'
Any help would be greatly appreciated
Here is the code for downloading files: