Can not preview the files in iOS ?
See original GitHub issuei am new to react-native i unable to preview the files after getting Uri path please help me
DocumentPicker.show({ filetype: [DocumentPickerUtil.allFiles()], },(error,res) => {
console.log(
res.uri,
res.type, // mime type
res.fileName,
res.fileSize
);
if(res) {
FileViewer.open(res.uri)
.then(() => {
console.log("Success")
})
.catch(_err => {
console.log("Error")
});
}
});
}`
2019-03-22 14:54:12.125034+0530 D_I_Picker[21219:7357050] [default] QLUbiquitousItemFetcher: <QLUbiquitousItemFetcher: 0x283e85ae0> could not create sandbox wrapper. Error: Error Domain=NSPOSIXErrorDomain Code=2 "couldn't issue sandbox extension com.apple.quicklook.readonly for '/file:/private/var/mobile/Containers/Data/Application/8B1B80D1-96E0-4415-9C82-7F0BC1EB4357/tmp/org.reactjs.native.example.D-I-Picker-Inbox/Jan%20to%20Feb%2021%20st%20stmt.pages': No such file or directory" UserInfo={NSDescription=couldn't issue sandbox extension com.apple.quicklook.readonly for '/file:/private/var/mobile/Containers/Data/Application/8B1B80D1-96E0-4415-9C82-7F0BC1EB4357/tmp/org.reactjs.native.example.D-I-Picker-Inbox/Jan%20to%20Feb%2021%20st%20stmt.pages': No such file or directory} #PreviewItem
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top GitHub Comments
@bhoomesh950 use this solution:
const decUrl = decodeURI(content.uri).replace('file://', '')
content.uri - uri from DocumentPickerI think I found the problem, in my case I had something like this “%20” (seems like an space) in the path I was using and I did something like this uri.replace(‘file://’, ‘’).replaceAll(‘%20’, ’ ') and it worked