tencent cloud

Smart Media Hosting

Obtaining a File Link

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-01-07 10:49:08

Introduction

This document provides an API overview about file download links, document preview links, and thumbnail links as well as SDK sample code.
API
Operation Description
Get document preview URL
Get photo/video cover thumbnail URL

SDK API Reference

For specific parameters and method descriptions of all SDK APIs, please see SDK API Reference.

Getting a File Preview

Feature Description

The preview URL is used to obtain the document.

Sample Code

QCloudSMHGetPresignedURLRequest *req = [QCloudSMHGetPresignedURLRequest new];
// Media Library ID, required parameter
req.libraryId = @"libraryId";
// Space ID, if the media library is in single-tenant mode, this parameter is fixed as a hyphen (-); if the media library is in multi-tenant mode, you must specify this parameter
req.spaceId = @"spaceId";
// version id
req.historyId = @"historVersionId";
// file path
req.filePath = @"filePath";
req.purpose = QCloudSMHPurposePreview;
[req setFinishBlock:^(NSString *result, NSError *_Nullable error) {
// result preview URL.
}];
[[QCloudSMHService defaultSMHService] getPresignedURL:req];


Getting a Thumbnail

Feature Description

Get thumbnail URL.

Sample Code

QCloudSMHGetPresignedURLRequest *req = [QCloudSMHGetPresignedURLRequest new];
// Media Library ID, required parameter
req.libraryId = @"libraryId";
// Space ID, if the media library is in single-tenant mode, this parameter is fixed as a hyphen (-); if the media library is in multi-tenant mode, you must specify this parameter
req.spaceId = @"spaceId";
// version id
req.historyId = @"historVersionId";
// file path
req.filePath = @"filePath";
// number of frames, frame processing targeting gif
req.frameNumber = 10;
// For image transformation parameters like size, scale, heightSize, and widthSize, check the api documentation.
req.size = size;
req.purpose = QCloudSMHPurposePreview;
[req setFinishBlock:^(NSString *result, NSError *_Nullable error) {
// result preview URL.
}];
[[QCloudSMHService defaultSMHService] getPresignedURL:req];



도움말 및 지원

문제 해결에 도움이 되었나요?

피드백