react-native-file-viewer icon indicating copy to clipboard operation
react-native-file-viewer copied to clipboard

Not able to open downloaded file in Android

Open sharadkatre19 opened this issue 3 years ago • 7 comments

Not able to open the downloaded file in Android. In iOS it works perfectly fine.

Path for Android local file:

/storage/emulated/0/download/test.pdf

For download file I am using RNFetchBlob.fetch(....) Thanks in Advance.

sharadkatre19 avatar Mar 21 '21 16:03 sharadkatre19

Have you finished this problem ? @sharadkatre19

bramadiwangkara-paykita avatar Apr 05 '21 17:04 bramadiwangkara-paykita

@sharadkatre19 try to add <root-path name="root" path="." /> in filepath.xml, it work for me :)

rizki-fr avatar Apr 06 '21 04:04 rizki-fr

@sharadkatre19 try to add

<root-path name="root" path="." />

in filepath.xml, it work for me :)

It works ! Wow big thanks

bramadiwangkara-paykita avatar Apr 06 '21 04:04 bramadiwangkara-paykita

hi, I don't have this file.... "filepath.xml" can someone tell me where should it be and how it should look like?...

Mihai-github avatar May 27 '21 19:05 Mihai-github

hi, I don't have this file.... "filepath.xml" can someone tell me where should it be and how it should look like?...

I added it to res/xml/file_viewer_provider_paths.xml. Still doesn't work for me

ghost avatar Jun 21 '21 14:06 ghost

@sharadkatre19 try to add <root-path name="root" path="." /> in filepath.xml, it work for me :)

@rizki-fr can you tell us where this file is situated exactly? I'm kind of stuck in this issue and if it works your way it'll be great to have this fixed.

heytulsiprasad avatar Jun 24 '21 04:06 heytulsiprasad

@sharadkatre19 try to add <root-path name="root" path="." /> in filepath.xml, it work for me :)

It works ! Wow big thanks

Mind sharing the filepath.xml path?

edit: I managed to solve the issue by switching to react-native-blob-util and handle the new Android scoped storage (as documented here https://github.com/RonRadtke/react-native-blob-util#android-media-storage). After that, opening the resulting path succeed without problem. Hope it will help someone!

YuukanOO avatar Apr 04 '22 09:04 YuukanOO