Search code examples
objective-cxcodeconnection

Objective-C: Transfering Files from DocsDirectory to Computer


I have a couple different apps that write text files to the Documents Directory of iPads.

I want to write another app, which would search the Documents Directory for certain files, read the data in the files, then write this data to a database. This would all happen while the iPad is plugged into a computer that is on the same network as the database.

Is this possible? I read that iOS apps cannot connect remotely to a database, so I was hoping that doing this in two steps, and plugging in the iPad into the computer while running the new app would alleviate the problem.

Thanks!


Solution

  • It is possible to write software that looks into the iPad's filesystem. [1] Should you do it? Probably not. It's also probably not very easy. And you would have to write this for every desktop OS you want to target. You would also probably have problems with encryption.

    Anyway, "iOS cannot connect remotely to a database" is a statement so broad that it cannot be correct.

    I agree that getting files on and off iOS devices is way too much of a hassle, so please feel free to file a bugreport at https://feedbackassistant.apple.com/

    Once you've done that, look around and you'll see there are many options you can take, none of which are perfect: You can use cloud syncing via iCloud (iOS/Mac only), Dropbox etc.; you can open your own http server on the device or a computer; you can use a webservice to upload and download files; you can make the user do all the work by just telling them to do it through iTunes...

    Don't forget to file that bug report! Apple will never change this if they don't get complaints about it. Be nice!

    [1] iExplorer is such a software. I am not affiliated, don't endorse, and make no claims about its quality. But I tried it once, and it does work.