Upload a directory: OSS SDKs do not support direct upload of directories. To upload multiple objects to the same directory, specify the same prefix for the objects that you want to upload and separate the prefix and the object names with forward slashes (/). For example, you want to upload the example1.txt, example2.txt, and example3.txt local files to the dir directory. In this example, OSS SDK for Java is used. You must set the object names to dir/example1.txt, dir/example2.txt, and dir/example3.txt during upload.
Download a directory: OSS SDKs do not support direct download of directories. However, you can download multiple objects to the same local directory. For example, you want to download all objects stored in a directory named folder from a bucket to a local directory named local.
When you know the objects stored in the folder directory
For example, the folder directory contains two objects: example1.jpg and example2.jpg. In this example, OSS SDK for Java is used. You must set the object names to folder/example1.jpg and folder/example2.jpg and the local paths to local/folder/example1.jpg and local/folder/example2.jpg when you download the objects in the directory.
When you do not know the objects stored in the folder directory
Query all objects in the folder directory by calling the GetBucket(ListObjects) operation.
Specify the object names and the full local paths respectively based on the preceding method.
For more information about the sample code that you can use to upload directories to and download directories from OSS by using OSS SDKs for various programming languages, see Overview.