itinance / react-native-fs

Native filesystem access for react-native
MIT License
4.9k stars 958 forks source link

save to "files" in IOS #1177

Open rohankm opened 1 year ago

rohankm commented 1 year ago

Hi, I'm unable to find a proper guide to storing a file in the "files app" in IOS Platform using RNFS. can someone help me, please?

ravirajn22 commented 1 year ago

If I am correct, you cannot directly save files to 'Files' app. You can only open 'Share'. https://reactnative.dev/docs/share From there the user have to click 'Save to Files'. iOS does not give access to Files

There is another option, but I have not used it. You have to first save the file in the app sandbox, then expose the folder to Files app.

jrmendonca commented 7 months ago

Hi, I'm unable to find a proper guide to storing a file in the "files app" in IOS Platform using RNFS. can someone help me, please?

You need to setup your iOS project in Info.PLIST

Set those with YES: Application supports iTunes file sharing (YES) Supports opening documents in place (YES) Application requires iPhone environment (YES)

Also point in your code the right directory. Something like "RNFS.DocumentDirectoryPath" It will work like charm.