11

I want to design an app which stores documents on iCloud. But there are some question which has answer before doing actual implementation.

The question are as follows,

  1. What is maximum file size to upload on iCloud?
  2. Can I programmatically calculate/know the available space on user's iCloud account?
  3. How can I get the event for uploading and Downloading files from iCloud?

Can anyone please help me here ? I read the apple documentation but not understood all the things completely.

Thanks In Advance.

2
  • Look at "ICACloud: iCloud" on GitHub, see the Blog Post by Drew McCormack. Great stuff!
    – zaph
    Commented Jan 30, 2014 at 13:29
  • How can i do this programmaticly
    – Ravi Ojha
    Commented Mar 26, 2015 at 12:54

1 Answer 1

12

Although you mentioned you've read the apple icloud documentation, the designing for icloud documentation page from Apple is still a good starting point for this question.

File Size Limits

The documentation doesn't specify a Document file size limit, nor a Core Data storage limit, other than a user account icloud storage allowance. There is a limit for Key Value storage which is 1Mb for a value (in a value-key pair), which could be an issue for you, but otherwise it seems you can store large files as long as the user has enough space available.

Given the 5gb default amount and accounting for the default user storage needs (photos, contacts, calendars and the like), you may encounter limits for Document and Core Data storage, like any other app. The file management for icloud page mentions good app behaviour:

Apps that take advantage of iCloud storage features should act responsibly when storing data in there. The space available in each user’s account is limited and is shared by all apps. In addition, users can see how much space is consumed by a given app and choose to delete documents and data associated with your app. For these reasons, it is in your app’s interest to be responsible about what files you store.

Check Available Space Programmatically

No

Upload/Download Events

The file uploading and downloading is handled by the OS. All files are stored locally, it's from this local store that you request/modify/save documents. From the icloud fundamentals page:

When you adopt iCloud, the operating system initiates and manages uploading and downloading of data for the devices attached to an iCloud account. Your app does not directly communicate with iCloud servers and, in most cases, does not invoke upload or download of data.

See this app coda tutorial for an example of key-value store integration, this Tim Roadley tutorial for Core Data store integration or this Ray Wenderlich tutorial for Document store integration.

Edit: The Document-Based App Programming Guide for iOS provides code snippets for moving files to/from iCloud, uploading and downloading as well as monitoring file changes. See "Downloading Document Files from iCloud" and "Moving a Document to iCloud Storage".

3
  • Thanks for your reply. I saw some app (for example Documents by Riddle) gets events for uploading and downloading files events. You know how they have achieve.
    – Vijay
    Commented Jan 30, 2014 at 13:15
  • 1
    Yes, see the edit at the end of my answer. That apple developer page has code samples you can use. Commented Jan 30, 2014 at 13:28
  • This is really helpful info. I am trying uploading/downloading for document store but unable to get event for uploading/downloading complete. Also facing problem to get upload/download progress.
    – Priya
    Commented Feb 6, 2014 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.