tencent cloud

Smart Media Hosting

Getting File Information

PDF
Focus Mode
Font Size
Last updated: 2026-01-07 11:03:08

Introduction

This document provides an API overview and SDK example code for getting file information.
API
Operation Description
Get file download link and info

Getting File Information

Feature Overview

For getting file information.

Example Code

//target file name
val targetName = "targetName"
//target folder
val targetDir = Directory()

try {
val fileInfo: FileInfo = smh.getFileInfo(
name = targetName,
dir = targetDir,
//historical version number
historyId = 123456,
//purpose (used to mark the usage scenario of the link)
purpose = Purpose.PREVIEW
)
} catch (e: Exception) {
e.printStackTrace()
}


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback