tencent cloud

CloudBase

Product Introduction
Product Overview
Features and Strengths
Use Cases
System Limits
Purchase Guide
Product Pricing
Description Of Billing Capability Items
Yearly/Monthly Subscription Package Description
Alarm and Notification
Overdue Payment Instructions
Development Guide
Cloud Storage
Database
Identity Verification
Cloud function
Static website management
SDK Documentation
Client SDK
Server SDKs
Management-side SDK
Product Agreement
Cloud Development Service Level Agreement

Deleting Files

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2025-12-31 11:48:16
By default, only users who have passed the login authentication can upload files to the cloud storage space. Therefore, login authentication should be performed first when files are uploaded on the user side (such as Web).
Note:
Up to 50 files can be deleted with one call; batch processing is required if the number exceeds 50.
By default, only the uploader, creator, or administrator of the file has the right to delete the corresponding file. User A is not allowed to delete User B's files.
You can also use custom security rules to set looser or stricter read/write permissions for cloud storage.
Using the SDK to call the deleteFile to delete one or multiple specified files in the cloud storage space.
Web
WeChat Mini Program
Node.js
//Step 1: Introduce the Web SDK.
import tcb from "@cloudbase/js-sdk";

//Step 2: Perform initialization.
const app = tcb.init({
env: "your-env-id"
});

//Step 3: Authenticate login. The following code is not complete. You need to select a login method. For details, see Quick Start > Login and User Cases.
const auth = app.auth({
persistence: "local" //The login authentication remains valid for 30 days until the user logs out or changes the password.
});

app
.deleteFile({
fileList: ["cloud://a/b/c", "cloud://d/e/f"]
})
.then((res) => {
console.log(res.fileList);
});

//First, use wx.cloud.init for initialization. There is no need to import the SDK again on the mini program side, and authentication is not required.
wx.cloud
.deleteFile({
fileList: ["cloud://a/b/c", "cloud://d/e/f"]
})
.then((res) => {
console.log(res.fileList);
});

const tcb = require("@cloudbase/node-sdk");
const app = tcb.init();

app
.deleteFile({
fileList: ["cloud://a/b/c", "cloud://d/e/f"]
})
.then((res) => {
console.log(res.fileList);
});



Ajuda e Suporte

Esta página foi útil?

comentários