IPWorks Cloud 2020 C++ Edition

Questions / Feedback?

CopyFile Method

Copies a file.

Syntax

ANSI (Cross Platform)
char* CopyFile(const char* lpszSrcFileId, const char* lpszDestBucketId, const char* lpszDestFileName);

Unicode (Windows)
LPWSTR CopyFile(LPCWSTR lpszSrcFileId, LPCWSTR lpszDestBucketId, LPCWSTR lpszDestFileName);
- (NSString*)copyFile:(NSString*)srcFileId :(NSString*)destBucketId :(NSString*)destFileName;
#define MID_BACKBLAZEB2_COPYFILE 8

IPWORKSCLOUD_EXTERNAL int IPWORKSCLOUD_CALL IPWorksCloud_BackblazeB2_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

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* 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 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 AccountCapabilities property for more information.

Error Handling (C++)

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

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