Release Notes
Announcements
// Bucket name, which consists of bucketname-appid (appid must be included), can be viewed in the COS console. https://console.tencentcloud.com/cos5/bucketlet bucket = "examplebucket-1250000000";//The location identifier of an object in a bucket, also known as the object keylet cosPath = "exampleobject.txt";//Local file pathlet srcPath = "Local file path";let putRequest = new PutObjectRequest(bucket, cosPath, srcPath);// Set the single link rate limit in bit/s, for example, 1M/s putRequest.addHeader("x-cos-traffic-limit", (1024 * 1024 * 8).toString()); let task: UploadTask = CosXmlBaseService.default().upload(putRequest);// Start upload task.start();
// Bucket name, which consists of bucketname-appid (appid must be included), can be viewed in the COS console. https://console.tencentcloud.com/cos5/bucketlet bucket = "examplebucket-1250000000";//The location identifier of an object in a bucket, also known as the object keylet cosPath = "exampleobject.txt";// Local file download path. If the file does not exist, the sdk will automatically create it.let downliadPath = "Local file path";let getRequest = new GetObjectRequest(bucket, cosPath, downliadPath);// Set the single link rate limit in bit/s, for example, 1M/s getRequest.addHeader("x-cos-traffic-limit", (1024 * 1024 * 8).toString()); let task: DownloadTask = CosXmlBaseService.default().download(getRequest);// Start download task.start();
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback