Upload/download files and create folders
tip
The following operation methods are only applicable to the public COS of the project. For managing your private COS, please use third-party software.
Upload files
Upload files to Cloud Object Storage (COS) bucket from your local computer:
- TWSC Portal
- TWCC CLI
- Enter Content page of the bucket, click UPLOAD.
- After Upload File(s) window pops up, you can directly drag the file or folder here, or click SELECT FILES.
- After selecting the file you want to upload, you can check the Encryption box on the left to encrypt the file with a key. Then click UPLOAD.
info
For more information on file encryption, please refer to: File Encryption.
- Click DONE when system shows Upload Successful!.
tip
- File limit: The maximum file size is 1GB, and the maximum number of files per upload is 1000. If you want to upload larger and more files, you can operate with third-party software such as S3 Browser.
- When uploading files using CLI, files may not be successfully uploaded to folders with names that start with "admin." We recommend avoiding using "admin" when naming folders, or using path style when uploading files, for example:
https://cos.twcc.ai/bucket name/admin
.
tip
- Files can be retrieved by relative path and absolute path to upload to buckets.
- When uploading files using CLI, files may not be successfully uploaded to folders with names that start with "admin." We recommend avoiding using "admin" when naming folders, or using path style when uploading files, for example:
https://cos.twcc.ai/bucket name/admin
.
Upload a single file -sync to-cos
- Upload a single file from the current path (file name:
testfile1
) - Use the view command to check whether the file is successfully uploaded to the target bucket
bk_cli
twccli cp cos -bkt bk_cli -fn testfile1 -sync to-cos
twccli ls cos -bkt bk_cli
- Upload a single file (file name:
test1
) from a relative path to thetestf1/
directory of the bucket.
twccli cp cos -bkt bk_cli -dir testf1/ -fn test1 -sync to-cos
- Upload all files in the relative path folder (folder name:
testf2
) to the target bucket
twccli cp cos -bkt bk_cli -dir testf2 -sync to-cos
Download files
Download files from COS bucket to your local computer:
- TWSC Portal
- TWCC CLI
- On Content page of the bucket, check the file you want to download and click DOWNLOAD button at the top of the page.
tip
Currently, you can only download one file at a time using Portal. If you want to download multiple files, you can operate with client software tools such as S3 Browser.
- Download a single file (file name:
testfile1
) from bucket to the current folder
- And check if the download is successful
twccli cp cos -bkt bk_cli -okey testfile1 -sync from-cos
twccli ls cos -bkt bk_cli
- Download the entire bucket to the specified directory
- And check if the download is successful
twccli cp cos -bkt bk_cli -dir download/ -sync from-cos
twccli ls cos -bkt bk_cli
Create folders
You can create folders to manage your files:
- TWSC Portal
- On Content page of the bucket, click CREATE FOLDER, enter a name for the folder and click OK.
info
The TWSC portal can only display up to 1000 data items (storages, folders, files). To view the complete data, please use the TWCC CLI or third-party software.