S3 Operations
In a project, you can perform operations such as uploading and downloading records and resources through S3.
Storage Paths
-
Records
The path of files in records within the corresponding S3 bucket is
records/<record-id>/files/<file-name>.For example, if the record ID is
123456and the file name isexample.txt, the file path would berecords/123456/files/example.txt.
-
Resources
The path of files in resources within the corresponding S3 bucket is
files/<file-name>.For example, if the file name in resources is
example.txt, the file path would befiles/example.txt.
Operation Examples
Using the AIStor Client(mc) tool as an example. Assume the project bucket is coscene.01, the record ID is 123456, the file name is example.txt, and the S3 configuration alias is coscene.
List Files
-
List files in a record
mc ls coscene/coscene.01/records/123456/files/ -
List files in resources
mc ls coscene/coscene.01/files/
Upload Files
-
Upload a file to a record:
mc put example.txt coscene/coscene.01/records/123456/files/ -
Upload a file to resources:
mc put example.txt coscene/coscene.01/files/
Download Files
-
Download a file from a record
mc get coscene/coscene.01/records/123456/files/example.txt . -
Download a file from resources
mc get coscene/coscene.01/files/example.txt .