GetTorrent Method
Gets a torrent file that can be used to download an object.
Syntax
amazons3.getTorrent(objectName, [callback])
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for this method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
This method gets a torrent file for the object specified by ObjectName in the bucket currently selected by Bucket.
If 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.