GetTorrent Method
Gets a torrent file that can be used to download an object.
Syntax
ANSI (Cross Platform) int GetTorrent(const char* lpszObjectName); Unicode (Windows) INT GetTorrent(LPCWSTR lpszObjectName);
- (void)getTorrent:(NSString*)objectName;
#define MID_AMAZONS3_GETTORRENT 19 IPWORKSCLOUD_EXTERNAL int IPWORKSCLOUD_CALL IPWorksCloud_AmazonS3_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);
Remarks
This method gets a torrent file for the object specified by ObjectName in the bucket currently selected by Bucket.
If a stream has been specified using SetDownloadStream, the torrent file will be sent through it. If a stream is not specified, and LocalFile is set, the torrent file will be saved to the specified location; otherwise, the torrent file will be held by ObjectData.
Note that, according to Amazon's documentation:
- Torrent files are only available for publicly-accessible objects less than 5GB in size.
- Torrent files cannot be requested for objects located in AWS regions that launched after May 30, 2016.
Error Handling (C++)
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.)