Ability to save files on internal storage
Ardy Febriansyah
Currently no feature, tips, trick or tutorial how to write files on interal storage not app directory (/data/data/com.package.name) with expo without detach
I want to save files on internal storage like Downloads, WhatsApp, DCIM, Pictures
This feature usefull for app with download files/picture/music feature
p
pavankommi
you can use these
https://docs.expo.dev/versions/latest/sdk/media-library/
https://docs.expo.dev/versions/latest/sdk/filesystem/
https://stackoverflow.com/questions/51353224/downloading-a-file-with-expo-why-is-this-so-hard
Sachin Motwani
I need the to download pdf to downloads folder of the internal storage, please add the feature of saving to device.
Salman
l am suffering to find any small piece of example about downloading files in expo project. Please provide clearer info about that.
V
Vivek S (Vicky)
Try above link it has the example. It is my example and it works actually but in some phone it does not. But try once it may work.
Wilbert Cedeno
We need this feature. I've seen some workarounds online using the Media Library, but it's not working reliably. Does anyone know of any other workarounds?
Diego
I think its a good feature, and it maybe related with a refactor of DocumentPicker, ImagePicker, MediaLibrary as they are useful for files/images manipulation. Maybe merge, for example DocumentPicker could accept array of mime types, option for pick directory
Abdul Sadık Yalçın
Urgently needed in my opinion. An old wrapper like cordova has this support and yet a modern rail like expo doesn't.
Osama Qarem
Hi, for now I alleviate the issue by using the Expo MediaLibrary. You will be able to create a folder at the root of internal storage with any name you'd like.
You can use
createAsssetAsync
on any type of file, and then createAlbumAsync
to create the folder and add the file at the root of storage. I successfully exported photos and .xlsx files from my app to the album. The photos will show in the gallery, but other types of files will not. Using a file manager you can view all saved files.
I also tried expo sharing, but there is no option to save to internal storage. Only to things such as google drive, bluetoth etc. Could be useful for anyone running into this feature request to consider.
Good luck.
afrozopsy dev
Osama Qarem: I had thought of the exact same idea, have tried it. It worked. For any one looking to save pdf/docs you can use the exact same procedure. And then use react-native-file-viewer to load it, for the default app installed in the phone for it.
Side Note: react-native-file-viewer uses ACTION_VIEW intent which requires native code to be implemented so you must eject for that. But the idea still persists, expo does have an API to read/write to internal storage using expo-media-library.
Cheers :)
Levani Melikishvili
Osama Qarem: Does not work on pdf files. I'm getting an error: "This file type is not supported yet" from MediaLibrary.createAssetAsync on ios.
V
Vivek S (Vicky)
Osama Qarem: While saving the .xlsx file, my app exits automatically. It's happening in the Android OS. I haven't checked it in iOS. Any idea regarding this?
Pawel
You can save files on iOS using expo-file-system and Share from react-native. But there is no way to achieve this on Android... +1
Taylor Moss
FYI for anyone looking. This is technically possible with React Native via a hack. https://forums.expo.io/t/how-to-save-the-file-to-devices-folder-like-download/2398/19 but I agree 100% having this built into expo filesystem with the move function would be great.
Aibar Makhat
this is a very necessary thing
Load More
→