简体   繁体   中英

Where to store files downloaded by application?

my iPhone application downloads image files from server and displays in image view. i have stored these files in tmp directory (ie NSTemporaryDirectory()). I dont want, user can backup downloaded files or these cant be taken on Mac when he/she connects phone to mac. How should I assure this? Thank you, in advance.

Read A Few Important Application Directories and Getting Paths to Standard Application Directories

Store your images in the temp, caches, or application support directories depending on if you want them included in device backups and if you want those files to remain on the device when your application is terminated.

Nothing will stop a determined user from retrieving data from a device they control but you can easily make sure you don't expose those file through file sharing or unintentionally include them in device backups and I think that's the level of assurance you were looking for.

You can encrypt the file before storing, then decrypt to display. This won't stop the most determined users (since your key will probably be embedded in your app), but it will thwart all but the most resourceful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM