Important: The information in this document is obsolete and should not be used for new development.
PostDownloadRequest
Requests the download of data referenced by Cyberdog item to disk and registers a completion notification function.
CDDownloadRequestID PostDownloadRequest (in CyberItem item, in FSSpecPtr destSpec, in ODBoolean decomp, in DownloadCompletionUPP completionProc, in Ptr completionProcData);
item- The
CyberItemobject that specifies the data to be downloaded to disk.destSpec- A pointer to a file specification that specifies the file in which to save the data.
decompkODTrueif the download part should attempt to decompress the downloaded data before saving it to the file; otherwise,kODFalse.completionProc- A pointer to a programmer-defined function that Cyberdog calls when the data has been downloaded to disk.
completionProcData- A pointer to data that is passed to the callback function specified by
completionProc.- return value
- An ID that uniquely identifies the download request.
DISCUSSION
This method adds a Cyberdog item to this download part's queue. Ifnilis specified for thedestSpecparameter, the download part decides where to save the data. To cancel a download request, you call theCancelRequestmethod, passing the ID returned by this method.This method is similar to
DownloadCyberItemexcept that it allows you to control whether the downloaded data is decompressed and to specify a callback function called by Cyberdog when the download operation is complete. The data pointed to by thecompletionProcparameter is passed to the callback function.The following type is used for download completion functions. The callback function takes five parameters: an environment parameter, a pointer to a Cyberdog item, an event code that describes the results of the download, a pointer to a file specification, and a pointer to some data.
The
typedef void (* DownloadCompletionProcPtr) (
Environment* ev,
CyberItem* item,
CDDownloadEvent eventCode,
FSSpec* destFile,
Ptr userDataPtr);MyDownloadCompletedprogrammer-defined function (page 191) illusrates the form of a download completion function.If you subclass
CyberDownloadExtension, you must override this method. Your override must not call its inherited method; that is, your override method must implement this method's functionality completely.SEE ALSO
TheDownloadCyberItemmethod (page 214).