oss_copy()

Read(123) Label: storage bucket, copy,

Description:

Copy a file in the OSSS bucket to local, or a local file to the OSS bucket.

Syntax:

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

Note:

External library function (See External Library Guide).

Parameter:

fd

OSS connection object

bucket

Bucket name

key

File name in the storage bucket

localFile

A local file name; save the file in the main directory if the parameter is absent

Option:

@u

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

Return value:

Boolean

Example:

 

A

 

1

=oss_open("LTAI5tRgzSpjU73Wt","4dNAtbcjF6arKp26JGaytM","http://oss-cn-beijing.aliyuncs.com")

Create an OSS connection.

2

=oss_copy(A1, "unbucket101":"test1.txt")

Copy test1.txt in bucket unbucket101 tomain directory/unbucket101.

3

=oss_copy(A1, "unbucket101":"test1.txt","D:/myBucket/test2.txt")

Copy test1.txt in bucket unbucket101 to D:/myBucket/test2.txt.

4

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

Copy the local file D:/myBucket/test2.txt to test3.txt in bucket unbucket101.

5

>oss_close(A1)

Close the OSS connection.