IPWorks Cloud 2020 macOS Edition

Questions / Feedback?

DownloadFile Method

This method downloads the file or the contents of the folder specified by the ItemId.

Syntax

public func downloadFile(itemId: String) throws -> Void

Remarks

The method will download the item specified by the ItemId. If LocalFile is set, the file or folder will be saved to the specified location. Otherwise, the class will use the data from the ItemData property; If the item is a directory, it will download the contents (recursively) of the directory as a ZIP file.

Note that the string root may be used as a FolderId to represent the root folder, and the string home may be used as a folder Id to represent the home folder for the current user. Other special id's include:

  • favorites
  • allshared
  • connectors
  • box
  • top

Name Conflict Resolution

If the Overwrite property is set to true, then the class will overwrite a file if one is found at the location specified by the LocalFile property. If it is set to false, then the class will throw an error if it finds a collision.

If LocalFile is set, the file will be saved to the specified location; otherwise, the file data will be held by ItemData.

To download and decrypt an encrypted file, set EncryptionAlgorithm and EncryptionPassword before calling this method.

Download Notes

Simple Download

A simple download is consistent with setting the LocalFile to the destination of the file when it is downloaded and then calling the method with the item's id. For example:

shareFile.LocalFile = "../MyFile.zip";
shareFile.DownloadFile(shareFile.Items[0].Id);

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 macOS Edition - Version 20.0 [Build 8265]