joltup / rn-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.81k stars 772 forks source link

Cannot open downloaded file in Folder [IOS] #652

Closed nightdaydream closed 3 years ago

nightdaydream commented 3 years ago

Hello. Downloaded file is opened in app and through error what it is "application dont file read" Info.plist contains all of these and combinations:

<key>UISupportsDocumentBrowser</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>UIFileSharingEnabled</key>
<true/>

But file doesn't want to open in Browser and redirect in App. Please, help, any ideas?

versions: "rn-fetch-blob": "0.12.0", "react-native": "0.62.2"

code from project:

....
const base64Data = response.data;
const fileLocation = `${RNFetchBlob.fs.dirs.DocumentDir}/${filename}`;
RNFetchBlob.fs.writeFile(fileLocation, base64Data, 'base64').then((res: any) => {
    if (isIOS) {
        FileViewer.open(fileLocation);
    } });
MannySauce commented 3 years ago

Did you find a solution for it? What is FileViewer? What kind of document were you dealing with? im having problems opening an excel file.. it downloads but doesn't open.

nightdaydream commented 3 years ago

Did you find a solution for it? What is FileViewer? What kind of document were you dealing with? im having problems opening an excel file.. it downloads but doesn't open.

nope, I've reopened issue in other explanations, but nobody asked... I also don't know how to fix it for files