IPWorks Cloud 2020 Python Edition

Questions / Feedback?

copy_file Method

Copies a file.

Syntax

def copy_file(src_file_id: str, dest_bucket_id: str, dest_file_name: str) -> str: ...

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 upload_file 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 content_type property, the Metadata* properties, 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 start_multipart_upload, and then use the copy_part 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 property for more information.

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