Mahesh
Mahesh

Reputation: 662

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 (i.e 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.

Upvotes: 0

Views: 231

Answers (2)

Jonah
Jonah

Reputation: 17958

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.

Upvotes: 2

Perception
Perception

Reputation: 80593

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.

Upvotes: 1

Related Questions