All Products
Search
Document Center

Object Storage Service:Use OSS SDK for Java to upload objects

Last Updated:Dec 02, 2024

This topic describes a variety of methods that Object Storage Service (OSS) SDK for Java provides to upload objects.

Objects are the basic unit for data operations in OSS. OSS SDK for Java provides the following methods that you can use to upload objects:

  • Simple upload: call the PutObject operation to upload an object that is up to 5 GB in size. Simple upload allows you to perform streaming upload and object upload.

  • Form upload: use an HTML form to upload an object that is up to 5 GB in size to a bucket.

  • Append upload: call the AppendObject operation to append content to an existing appendable object. Append upload allows you to upload an object that is up to 5 GB in size.

  • Resumable upload: resume an upload task from the position recorded in the checkpoint file if an object fails to be uploaded because of a network exception or program error. Concurrent upload is supported. You can specify the size of each part. This method is suitable for uploading large objects. Resumable upload allows you to upload an object that is up to 48.8 TB in size.

  • Multipart upload: split a large object into multiple parts and upload the parts to OSS. Multipart upload allows you to upload an object that is up to 48.8 TB in size. This method is suitable for uploading large objects.

During the upload task, you can specify object metadata and view the upload progress. For more information, see Manage object metadata and Progress bar. After the upload task is complete, you can receive callbacks. For more information, see Upload callbacks.