On the iPhone where the file downloaded from the iOS application is saved

From my application, I can download the zip file from the server via NSURLConnection. While I upload, I write this to a file so that it is saved in documentsDirectory.

paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); documentsDirectory = [paths objectAtIndex:0]; currentDownload = [documentsDirectory stringByAppendingString:@"/Zipfile"]; NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:currentDownload]; [fileHandle seekToEndOfFile]; [fileHandle writeData:data]; [fileHandle closeFile]; 

This is the code I used to download and run it. If I run the application in the simulator, I can see the downloaded file in the MAC in the folder / Users / TECSOLiMac 02 / Library / Application Support / iPhone Simulator / 6.0 / Applications / 9DECB1F4-C88D-4B62-BA1F-B9D5D4E421B9 / Documents / Zipfile

Where can I see this downloaded file in iPhone / iPad?

+4
source share
3 answers

Each application is isolated on the iPhone. Each application has it in the directory structure on the device (for example, in the simulator).

The document directory path on the mobile device looks something like this:

<strong> / VAR / mobile / Applications / AAAAAAAAA-BBBB-CEC-DDDD-EEEEEEFFFFFFF / Documents /

Files in these directories cannot be accessed by any other applications. Access to it can be carried out by the owner. And you can access it through code.

If you want to see files in the document directory, you need to set the UIFileSharingEnabled key in the UIFileSharingEnabled file

info.plist

Files in the application document directory will be displayed on itunes as follows:

File sharing See the tutorial for more details.

+3
source

If you want to see these files on iPhone / iPad, you must enable (set the value to "YES") "The application supports the exchange of iTunes files" in the Info-project.

+1
source

After downloading the file, it’s easy to go to the settings of the same application and enable file sharing. Then click on the file and click save to camera roll , that’s all.

0
source

All Articles