IBackgroundCopyFile2::SetRemoteName method

Changes the remote name to a new URL in a download job.

Syntax

HRESULT SetRemoteName(
  [in] LPCWSTR RemoteName
);

Parameters

RemoteName [in]

Null-terminated string that contains the name of the file on the server. For information on specifying the remote name, see the RemoteName member.

Return value

This method returns the following return values, as well as others.

Return code Description
S_OK
Success
E_INVALIDARG
The new remote name is an invalid URL or the new URL is too long (the URL cannot exceed 2,200 characters).

Remarks

Typically, you call this method if you want to change the URL used to transfer the file or if you want to change the file name or path.

This method does not serialize when it returns. To serialize the change, suspend the job, call this method (if changing multiple files in the job, use a loop), and resume the job. Calling the IBackgroundCopyJob::Resume method serializes the change.

If the time stamp or file size of the new remote name is different from the previous remote name or the new server does not support checkpoint resume (for HTTP remote names), Delivery Optimization restarts the download. Otherwise, the transfer resumes from the same position on the new server. Delivery Optimization does not restart already transferred files.

Requirements

Requirement Value
Minimum supported client
Windows 10, version 1709 [desktop apps only]
Minimum supported server
Windows Server, version 1709 [desktop apps only]
Header
Deliveryoptimization.h
IDL
DeliveryOptimization.idl
Library
Dosvc.lib
DLL
Dosvc.dll
IID
IID_IBackgroundCopyFile2 is defined as 83e81b93-0873-474d-8a8c-f2018b1a939c

See also

IBackgroundCopyFile2