Upload Files
#
Enqueue File#
Upload File from Application SandboxTo upload a file from the application sandbox, you need to add it to the upload queue:
clfm.uploader.enqueueFile(path.path, to: destinationPath, with: true)
After the directory has been reloaded (see chapter Read Directory Content), the corresponding FileItem
s property operation
will contain a reference to the OperationUpload object with the float property progress
. This property is used to display the upload progress.
To cancel the upload, you need to call CloudikeFilesManager.shared.uploader.cancelFile(path)
. Where path is the full destination path of the file being uploaded.
#
Upload Photo or Video from Device GalleryTo upload photo or video drom device gallery, you need to add it to the upload queue:
clfm.uploader.enqueueAsset(asset.localIdentifier, to: destinationPath, with: true)
After the directory has been reloaded (see chapter Read Directory Content), the corresponding FileItem
s property operation
will contain a reference to the OperationUpload object with the float property progress
. This property is used to display the upload progress.
To cancel the upload, you need to call CloudikeFilesManager.shared.uploader.cancelFile(path)
. Where path is the full destination path of the file being uploaded.
#
Monitor Upload StatusTo monitor upload status you can subscribe on CloudikeFilesManager.shared.uploader.uploadStatus
. For more information see Monitor Download Status chapter.