Type Function Return value none Revision 2017.3060 Keywords iCloud, sync, storage, document, docDownload See also iCloud.docEvict() iCloudDocEvent iCloud.*
iCloud Documents do not necessarily exist on disk and the system may evict them if disk space is needed. To speed up document access, call this function to initiate a download and invoke the onComplete listener function with an iCloudDocEvent.
The onComplete listener function is called when the download is initiated, not when the download completes.
iCloud.docDownload( params )
Table. Table containing
Valid keys for the params table include:
filename — Required; file to be downloaded.
onComplete — Required listener function to be invoked with an iCloudDocEvent.
containerId — Optional string value indicating a specific iCloud Container to be used for document storage. Do not pass this parameter if you have only one iCloud Container associated with your app.
local function docListener( event )
if event.isError then
print( event.error )
print( event.errorCode )
end
end
iCloud.docDownload(
{
filename = "test.txt",
onComplete = docListener
}
)