CopyResource Method

Copies the currently selected resource.

Syntax

int CopyResource(const QString& qsParentId, const QString& qsNewName);

Remarks

This method copies the resource currently selected by RemoteId or RemotePath. The following outcomes are possible depending on which of NewName and ParentId are provided:

Parameters Provided Effect
Only NewName Copies the resource in place with the new name.
Only ParentId Copies the resource to the given parent with the same name.
NewName and ParentId Copies the resource to the given parent with the new name.
None Exception; at least one parameter must be provided.

ParentId, if provided, must either be the Id of a folder resource that already exists in the drive currently selected by Drive, or root (an alias for the root of the drive).

Monitoring Copy Operations

All copy operations are asynchronous. After calling CopyResource, the CopyStatusURL configuration setting will be populated with a copy operation monitor URL.

The PollCopyStatus method can be used to retrieve the latest status of the copy operation specified by the CopyStatusURL configuration setting. Calling PollCopyStatus will populate the CopyPercentDone, CopyStatus, and (if applicable) CopiedResourceId properties.

Error Handling

This method returns a 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. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

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