You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Document preview
Document preview
Copy page
Download PDF
Document preview
The document preview (doc-preview) feature lets you see document files stored in a bucket online without opening them. This topic introduces the parameters and provides examples of the document preview feature.​
Notes​
  • This feature is currently in closed beta. Please contact your account manager for access.​
  • You must use custom domains to preview documents in buckets created after January 3, 2024, due to restrictions on domain names. For instructions, see Associating a custom domain.​
tip​
For buckets created after January 3, 2024, accessing objects via the default domain name—whether through a presigned URL or anonymous access—will cause TOS to download the object directly to your device rather than providing an online preview. For more information, see Notice Regarding Restricting the Use of Torch Object Storage Default Domains.​
Supported parameters​
Request parameters​
​
Parameter​
Description​
Value​
Required​
x-tos-doc-src-type​
Specifies the type of file you want to preview.​
tip​
Currently, TOS uses the file name extension of an object to determine its source data type during file conversion. This parameter must be specified if an object lacks a file name extension.​
pptx, ppt, doc, docx, xls, xlsx, and pdf.​
No​
x-tos-doc-dst-type​
Specifies the output format.​
tip​
When you preview a spreadsheet file as images, one sheet can be split into several images during conversion.​
png, jpg, pdf, and html.​
The default value is jpg.​
No​
x-tos-doc-page​
Specifies the page number to be converted when the output format is an image.​
tip​
The page parameter does not apply when the output format is pdf or html because page selection is unavailable for those formats.​
[1,5000]​
The default value is 1.​
No​
x-tos-doc-image-dpi​
Renders the image at the specified DPI. This parameter only applies when the output format is png or jpg.​
Setting a low value decreases processing time, whereas setting a high value increases it.​
[96-600]​
The default value is 300.​
No​
x-tos-doc-image-quality​
Specifies the quality of the transcoded image.​
For example, a value of 90 indicates 90% image quality.​
[1,100]​
The default value is 90.​
No​
​
Response fields​
​
Field​
Description​
Value​
content-type​
Returns a value based on the actual format of the image.​
image/jpeg, image/png, application/pdf, and text/html.​
x-tos-total-page​
Returns the total number of pages in the document. For spreadsheet files, the value of this field indicates the total number of images converted from the current sheet.​
-​
​
Examples​
Example file URLs:​
To preview the first page of the example files as a JPG image, use the following URLs:​
To preview the example files as PDFs, use the following URLs:​
To preview the example files as HTML, use the following URLs:​
​
Last updated: 2026.08.03 11:26:06