This topic provides examples of how to upload objects with common tosutil commands on macOS.
Example folder
The local example folder is structured as follows:
Common examples
The following commands illustrate various upload scenarios based on the structure of the example folder.
Upload the file3.txt file in the local folder1 folder to the root directory of the bucketname bucket
After the upload is complete, the following object will be generated in the bucket:
Upload a local file and rename it
Upload the file3.txt file in the local folder1 folder to the root directory of the bucketname bucket and rename it to aaa.txt
After the upload is complete, the following object will be generated in the bucket:
Upload a local file to a bucket directory
Upload the file3.txt file in the local folder1 folder to the folder folder of the bucketname bucket
After the upload is complete, the following object will be generated in the bucket:
Upload a local folder (including the folder itself)
Upload all files in the local folder2 folder (including the folder itself) to the root directory of the bucketname bucket
After the upload is complete, the following objects will be generated in the bucket:
Upload a local folder (including the folder itself) to a bucket directory
Upload all files and subfolders in the local folder1 folder (including the folder itself) to the folder0 folder in the bucketname bucket
After the upload is complete, the following objects will be generated in the bucket:
Upload a local folder (excluding the folder itself) to a bucket directory
Upload all files and subfolders in the local folder1 folder (excluding the folder itself) to the folder0 folder in the bucketname bucket
After the upload is complete, the following objects will be generated in the bucket:
Upload files with specified names from the local folder
Upload all .txt and pi?1.png files from the local folder4 folder to the bucketname bucket
After the upload is complete, the following objects will be generated in the bucket:
Upload files that meet the specified conditions from the local folder
Upload all files, except the .png files, from the local folder4 folder to the bucketname bucket
After the upload is complete, the following objects will be generated in the bucket: