Freigeben über


CReplicationClient.SendFile Method

Sends a single file to each destination server that is defined for the Commerce Server Staging (CSS) project.

Note

This method and the CReplicationClient object are used only to stage individual files. You cannot use this method to stage projects.

void SendFile(string file)

Parameters

  • file
    The file to replicate. This string should include only the portion of the path that is relative to the project. It should not include the full path.

Remarks

You must have CSS administrator or operator rights on the project to call this method.

If a connection to a destination server has already been established, the SendFile method sends the specified file. Otherwise, it connects to the destination server, sends the file, and then disconnects, committing the file.

If transaction processing is turned on at the destination servers, the file transaction is not applied until either the Commit method or the Disconnect method is called.

Because the SendFile method does not use the CSS service on the source staging server, the replication information is not logged on the source server.

Note

You cannot call the SendFile method when you are replicating a project on a source staging server. If you try to do both, CSS refuses, and issues an error message.

The CReplicationClient.SendFile method corresponds to the COM method named ReplicationClient.SendFile.

Example

The following example sends the file Newfile.htm to all the destination servers that are defined for Project1.

CReplicationClient replicationClient = new CReplicationClient();
replicationClient.Initialize("Project1");
replicationClient.SendFile("Newfile.htm");

See Also

Other Resources

CReplicationClient.DeleteFile Method

CReplicationClient.GetExtendedErrorInfo Method

CReplicationClient.SendFiles Method

CReplicationProject.EnumDestination Method

CReplicationClient Class