The appendfromfile command is used to append content to the end of objects that are uploaded by using the AppendObject operation.
- The commands described in this topic are for 64-bit Linux systems. To use the commands in the examples on 64-bit Windows systems, replace ./ossutil64 in the commands with ossutil64.exe.
- For more information about append upload, see Append upload.
./ossutil64 appendfromfile localfilename oss://bucketname objectname [--meta ]
The following table describes the parameters that you can configure when you run this command.
|localfilename||The complete path of the file you want to upload.|
|bucketname||The name of the bucket in which the object you want to append is stored.|
|objectname||The name of the object to which you want to append content. When you upload an object, you can retain the original name of the uploaded file or specify another name.|
|--meta||Configures the metadata of the uploaded object. This parameter is supported only when
the appendfromfile command is used to upload an object for the first time. Example:
In the following examples, the file named exampleobject.txt in the root directory is uploaded for the first time to a bucket named examplebucket. Then, append upload is used to append content to exampleobject.txt multiple times.
- You can run the following command to upload the file named exampleobject.txt and set
the ACL of the uploaded object to private:
./ossutil64 appendfromfile exampleobject.txt oss://examplebucket/exampleobject.txt --meta "x-oss-object-acl:private"
If the following results are displayed, it indicates that exampleobject.txt is uploaded to the bucket and is 5 bytes in size.
total append 5(100.00%) byte,speed is 0.00(KB/s) local file size is 5,the object new size is 5,average speed is 0.04(KB/s)
- You can run the following command to append the content of the file named dest.txt
If you want to append additional content to exampleobject.txt, run the following command but replace dest.txt with the file name whose content you want to append to exampleobject.txt.
./ossutil64 appendfromfile dest.txt oss://examplebucket/exampleobject.txt
If the following results are displayed, it indicates that content is appended to exampleobject.txt. The size of exampleobject.txt becomes 150 bytes after the append upload.
total append 150(100.00%) byte,speed is 0.00(KB/s) local file size is 150,the object new size is 150,average speed is 1.19(KB/s)
To use ossutil to manage buckets that are located in different regions, you can use the -e option to use the endpoint of the specified bucket. To use ossutil to manage buckets that are owned by different Alibaba Cloud accounts, you can use the -i option to use the AccessKey ID of the specified account, and use the -k option to use the AccessKey secret of the specified account.
./ossutil64 appendfromfile exampleobject.txt oss://examplebucket/exampleobject.txt -e shanghai.aliyuncs.com -i LTAI4Fw2NbDUCV8zYUzA**** -k 67DLVBkH7EamOjy2W5RVAHUY9H****
For more information about the appendfromfile command, see Common options.