tencent cloud

masukan

Single-URL Speed Limits

Terakhir diperbarui:2024-02-04 17:20:25

    Overview

    This document describes how to limit the speed on a single URL when calling the upload or download API.

    Use Instructions

    The speed range is 819200 to 838860800 (in bit/s), that is, 100 KB/s to 100 MB/s. If a value is not within this range, 400 will be returned.
    Note:
    For more information about the speed limits on object downloads, please see Single-URL Speed Limits.

    Sample 1: limiting single-URL speed on uploads

    cos.putObject({
    Bucket: 'examplebucket-1250000000', /* Your bucket name. Required. */
    Region: 'COS_REGION', /* Bucket region, such as `ap-beijing`. Required. */
    Key: '1.jpg', /* Object key stored in the bucket (such as `1.jpg` and `a/b/test.txt`). Required. */
    StorageClass: 'STANDARD',
    Body: fileObject, // Upload the file object.
    Headers: {
    'x-cos-traffic-limit': 819200, // The speed range is 819200 to 838860800, that is 100 KB/s to 100 MB/s. If the value is not within this range, 400 will be returned.
    },
    onProgress: function(progressData) {
    console.log(JSON.stringify(progressData));
    }
    }, function(err, data) {
    console.log(err || data);
    });

    Sample 2: limiting single-URL speed on downloads

    cos.getObject({
    Bucket: 'examplebucket-1250000000', /* Your bucket name. Required. */
    Region: 'COS_REGION', /* Bucket region, such as `ap-beijing`. Required. */
    Key: '1.jpg', /* Object key stored in the bucket (such as `1.jpg` and `a/b/test.txt`). Required. */
    Headers: {
    'x-cos-traffic-limit': 819200, // The speed range is 819200 to 838860800, that is 100 KB/s to 100 MB/s. If the value is not within this range, 400 will be returned.
    },
    }, function(err, data) {
    console.log(err || data.Body);
    });
    Hubungi Kami

    Hubungi tim penjualan atau penasihat bisnis kami untuk membantu bisnis Anda.

    Dukungan Teknis

    Buka tiket jika Anda mencari bantuan lebih lanjut. Tiket kami tersedia 7x24.

    Dukungan Telepon 7x24