IPWorks Cloud 2020 Kotlin Edition

Questions / Feedback?

CopyFile Method

Copies a file.

Syntax

public fun copyFile(srcFileId: String?, destBucketId: String?, destFileName: String?): String?

Remarks

This method copies the file version specified by SrcFileId to the bucket specified by DestBucketId with the name DestFileName. The Id of the newly-created file is returned. If DestBucketId is empty, the source file's bucket is used as the destination bucket.

DestFileName is subject to the same restrictions described in the UploadFile method's documentation; refer to it for more information. If a file named DestFileName already exists in the destination bucket, a new version of it is created.

If the SendMetadataOnCopy configuration setting is enabled, and the ContentType property, the Metadata collection, and/or the ClientModifiedTime configuration setting are non-empty, then their values will be applied to the destination file. Otherwise, the server will copy the source file's content type and metadata to the destination file.

Finally, note that this method can only be used to copy files up to 5GB in size (or, if Range is non-empty, a range of up to 5GB of data from a larger file). To copy more than 5GB of data, start a new multipart upload with StartMultipartUpload, and then use the CopyPart method to copy the desired data in parts.

The currently-authenticated application key must have the writeFiles and (if the source file's bucket kind is allPrivate) readFiles capabilities to call this method successfully, otherwise the server will return an error. Refer to the Account.Capabilities field for more information.

Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Kotlin Edition - Version 20.0 [Build 7941]