s3_copy()

Read(2306) Label: s3, copy,

Description:

Copy a file in the storage bucket to local, or a local file to a bucket.

Syntax:

s3_copy(fd,bucket:key, [localFile])

Note:

External library function (See External Library Guide).

Parameter:

fd

S3 connection object

bucket

Bucket name

key

Name of a file in the storage bucket

localFile

Local file name, which is located in the main directory if the name is omitted; its path is [main directory]/ storeType/bucket/object

Option:

@u

Copy a local file into AWS S3 bucket; when the local path is a relative one, it is relative to the main directory

Return value:

Boolean

Example:

 

A

 

1

=s3_open("ASIAVSPDUYZ7O7WTX7C3":"7/5xYPO7a+9Po+IE1ySbmu9UB2hWIkWek1Sqn6E4":"us-east-2":"https://s3.us-east-2.amazonaws.com")

Connect to AWS S3.

2

=s3_copy(A1, "gogotest1":"test1.txt")

Copy test1.txt in bucket gogotest1 into the directorymain directory/s3/gogotest1.

3

=s3_copy(A1, "gogotest1":"test1.txt","D:/myBucket/test2.txt")

Copy test1.txt in bucket gogotest1 into the local file D:/myBucket/test2.txt.

4

=s3_copy@u(A1, "test1":"test3.txt","D:/ myBucket/test2.txt")

Copy the local file D:/myBucket/test2.txt into test3.txt in bucket test1.

5

=s3_copy@u(A1, "test1":"emp.txt","employee.txt")

Copy employee.txt in the main directory/s3 into emp.txt in bucket test1.

6

>s3_close(A1)

Close AWS S3 connection.