GET /<ObjectKey>?ci-process=doc-preview&dstType=html HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT Date
Name | Description | Type | Required |
ObjectKey | Object name, such as folder/document.pdf . | String | Yes |
ci-process | COS' processing capability, which is fixed at doc-preview for HTML preview. | String | Yes |
dstType | Output target file type, which is fixed at html for HTML preview. | String | Yes |
srcType | Source file type as listed below. | String | No |
sign | Object download signature, which must be URL-encoded. If the previewed object is privately readable, the signature needs to be passed in. For more information, see Request Signature. | String | No |
copyable | Whether the file content is copyable. Valid values: 1 (yes), 0 (no). | String | No |
htmlParams | Custom configuration parameters in JSON structure, which must be URL-safe Base64-encoded as described in FAQs. Default configuration: { commonOptions: { isShowTopArea: true, isShowHeader: true } }. For supported configurations, see Custom Configuration Overview. | String | No |
htmlwaterword | String | No | |
htmlfillstyle | Watermark RGBA (color and transparency), which must be URL-safe Base64-encoded as described in FAQs and is rgba(192,192,192,0.6) by default. | String | No |
htmlfront | Watermark text style, which must be URL-safe Base64-encoded as described in FAQs and is bold 20px Serif by default. | String | No |
htmlrotate | Rotation angle of the watermark text in degrees. Value range: 0–360. Default value: 315 . | String | No |
htmlhorizontal | Horizontal spacing of the watermark text in px. Default value: 50 . | String | No |
htmlvertical | Vertical spacing of the watermark text in px. Default value: 100 . | String | No |
test.pptx
ObjectKey in the examples-1258125638
bucket online, the final URL is as follows:https://examples-1258125638.cos.ap-guangzhou.myqcloud.com/test.pptx?ci-process=doc-preview&dstType=html
test.pptx
ObjectKey in the examples-1258125638
bucket online.copyable
to 0
.htmlwaterword=dGVzdAog
.htmlParams
is {"mode":"normal","commonOptions":{"isShowHeader":false,"isShowTopArea":true},"pptOptions":{"isSlidesStatusPlay": true}}, which is URL-safe Base64-encoded into htmlParams=eyJtb2RlIjoibm9ybWFsIiwiY29tbW9uT3B0aW9ucyI6eyJpc1Nob3dIZWFkZXIiOmZhbHNlLCJpc1Nob3dUb3BBcmVhIjp0cnVlfSwicHB0T3B0aW9ucyI6eyJpc1NsaWRlc1N0YXR1c1BsYXkiOiB0cnVlfX0=
.https://examples-1258125638.cos.ap-guangzhou.myqcloud.com/test.pptx?ci-process=doc-preview&dstType=html©able=0&htmlwaterword=dGVzdAog&htmlParams=eyJtb2RlIjoibm9ybWFsIiwiY29tbW9uT3B0aW9ucyI6eyJpc1Nob3dIZWFkZXIiOmZhbHNlLCJpc1Nob3dUb3BBcmVhIjp0cnVlfSwicHB0T3B0aW9ucyI6eyJpc1NsaWRlc1N0YXR1c1BsYXkiOiB0cnVlfX0=
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport"content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,user-scalable=no"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"><meta name="keywords" content="COS, file preview"><meta name="description" content=""><title>Tencent Cloud - COS - file preview</title><style>html,body {padding: 0;margin: 0;height: 100%;touch-action: manipulation;}</style></head><body><iframe src="https://examples-1258125638.cos.ap-guangzhou.myqcloud.com/test.pptx?ci-process=doc-preview&dstType=html©able=0&htmlwaterword=dGVzdAog&htmlParams=eyJtb2RlIjoibm9ybWFsIiwiY29tbW9uT3B0aW9ucyI6eyJpc1Nob3dIZWFkZXIiOmZhbHNlLCJpc1Nob3dUb3BBcmVhIjp0cnVlfSwicHB0T3B0aW9ucyI6eyJpc1NsaWRlc1N0YXR1c1BsYXkiOiB0cnVlfX0=" width="100%" height="100%" allowFullScreen="true"></iframe></body></html>
Apakah halaman ini membantu?