Cloud Storage
Cloud Storage is the file storage capability provided by Cloud Development for users. Users can operate the storage through CLI tools and SDK provided by Cloud Development, such as uploading and downloading files. Files stored in Cloud Storage are provided with CDN-accelerated access by default, enabling users to quickly access files in Cloud Storage.
Path Description
localPath
is the path of a local file or folder, in the form ofdirectory/filename
, such as./index.js
,static/css/index.css
, etc.cloudPath
is the path of a Cloud Storage file or folder relative to the root directory, in the form ofdirectory/filename
, such asindex.js
,static/css/index.js
, etc.
In Windows systems, localPath
follows the local path format, which is recognizable by the system and typically uses the \
separator. cloudPath
is a cloud file path and must use the /
separator.
Upload files
You can use the following command to upload files/folders. When the CLI detects that localPath is a folder, it will automatically upload all files within the folder.
tcb storage upload localPath cloudPath
Download files
You can use the following command to download files/folders. When downloading a folder, you need to specify the --dir
parameter.
# Download files.
tcb storage download cloudPath localPath
# Download folders.
tcb storage download cloudPath localPath --dir
Download all files.
When cloudPath
is set to /
, it means downloading all files in cloud storage.
# Download folders.
tcb storage download / localPath --dir
Deleting Files
You can use the following command to delete cloud files/folders. When deleting a folder, you need to specify the --dir
parameter.
# Delete files.
tcb storage delete cloudPath
# Delete folders.
tcb storage delete cloudPath --dir
Delete All Files
When the cloud path is empty, it means all files in cloud storage will be deleted.
tcb storage delete
Listing Files
You can use the following command to list files in a folder.
tcb storage list cloudPath
Getting File Access Links
You can use the following command to obtain a temporary access link for a file.
tcb storage url cloudPath
Getting Basic File Information
You can use the following command to retrieve basic file information.
tcb storage detail cloudPath
Getting File Access Permissions
You can use the following command to retrieve the access permission settings for a file.
tcb storage get-acl
Setting File Access Permissions
You can use the following command to set file access permissions.
tcb storage set-acl