The IDownloadCmd2 interface is used to initialize the data contained in the Download command component, which silently downloads a specific version of an object store item and saves it to a specified file on the local machine. Using this interface, the client application indicates which item to download and may also identify which content element to download using the index value.
NOTE When initializing with the IDownloadCmd2 interface, you only need to supply the destination directory for the file. The interface will extract the filename from the HTTP response headers attachment name. However, if you prefer to provide the full pathname for the file, use the IDownloadCmd interface instead.
After the Download command has been executed by calling IAppIntCmd::Invoke, a Download response component is returned. The response component contains specific Download command data that is accessible through the IDownloadRsp interface.
coclass DownloadCmd {
[default] interface IDownloadCmd; interface IDownloadCmd2;
interface IAppIntCmd;
};
DLL | FnAppIntDownloadCmd.dll |
See Also | IDownloadCmd and IDownloadRsp Interfaces |
The IDownloadCmd2 interface defines one method:
Method | Description |
---|---|
InitializeAttachment |
Initializes the Download command by specifying an object store item to download and providing a location for the saved file on the local machine. |
The following is a fragment which demonstrates how to call the IDownloadCmd2 interface which is very similar to the IDownloadCmd interface. The Download command section contains a complete example of how to use the IDownloadCmd interface.
...
// Instantiate the custom Download command component
IDownloadCmd2Ptr spIDownloadCmd2;
hResult = spIDownloadCmd2.CreateInstance(__uuidof(DownloadCmd));
if (FAILED(hResult)) {
std::cout << "Could not create the Download command component.\n";
_ASSERTE(0);
}
...