tencent cloud

Smart Media Hosting

Product Introduction
Product Overview
Feature Description
Product Strengths
Use Cases
Basic Concept
Purchase Guide
Quick Start
Create Media Library
Initiate request
Service Level API Document
History
Introduction
API Category
Making API Requests
PaaS Service APIs
Official Cloud Disk APIs
Data Types
Error Codes
Business Level API Document
Introduction
Access Token Operation API
Tenant Space Operation API
File Operation API
Directory or Album Operation API
Recycle Bin Operation API
Quota Operation API
Query Task Operation API
Search Operation API
Historical Version Operations API
Directory and File Batch Operation API
Collection Operation API
Error Codes
SDK Documentation
Android SDK
iOS SDK
HarmonyOS SDK
FAQs
Enterprise Network Disk
Product Introduction
Purchase Guide
Quick Start
FAQs
Service Level Agreement
Glossary

Creating a File Link

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-01-07 11:03:07

Introduction

This document provides an API overview about file renaming as well as SDK sample code.
API
Operation Description
Generate File URL

Creating a File Link

Feature Overview

To create a file link.

Example Code

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

try {
val createSymLinkResult: ConfirmUpload = smh.createSymLink(
name = targetName,
dir = targetDir,
sourceFileName = sourceName,
//Whether to overwrite or rename when duplicate names exist. true means overwrite, false means rename.
overrideOnNameConflict = false
)
//URL of successfully created file
val path = createSymLinkResult.path.joinToString("/")
} catch (e: Exception) {
e.printStackTrace()
}


도움말 및 지원

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

피드백