You can upload any types of files, including images, documents, and videos, to OSS buckets. Uploaded files are stored as objects in OSS buckets. An object contains a file and metadata that describes the file. You can upload a large number of objects to a bucket at a time.
Upload methods
OSS provides the following methods to upload files:
Simple upload: This method is suitable for uploading a small file that is up to 5 GB in size. You can call the PutObject operation that is provided by OSS to upload a file. No configuration is required.
Multipart upload: This method is suitable for uploading a large file that is up to 48.8 TB in size. You can call the InitiateMultipartUpload, UploadPart, and CompleteMultipartUpload operations to split a file into multiple parts and upload the parts in parallel. After you upload the parts, you can combine all parts into a complete object. If the upload is interrupted due to a network exception, the client manually records the failed parts and re-uploads the parts.
Append upload: This method is suitable for uploading a file to append, such as a video stream. A single file to upload can be up to 5 GB in size. You can call the AppendObject operation that is provided by OSS to upload the files and generate appendable objects. You can append content to existing appendable objects. Data that is appended to an appendable object can be immediately read. Append upload supports only appendable objects.
Resumable upload: This method is suitable for uploading a large file that is up to 48.8 TB in size over unstable networks. You can call the multipart upload-based method that is provided by OSS SDKs, such as the
uploadFile
method provided by OSS SDK for Java, to automatically record the upload progress on the client and resume the upload from the position at which the upload stops.Form upload: This method is suitable for uploading an object that is up to 5 GB in size in an HTML page by initiating an HTTP POST request to OSS. You can use the policy generated by the server to limit the attributes of an object that you want to upload, such as the object size and type.
References
You can use the upload progress bar that is provided by OSS SDKs to display the upload progress and the remaining time that is required to complete the object upload. For more information, see Upload progress bar.
If you want to control the caching, downloading, and processing of uploaded objects, you can configure object metadata, such as standard HTTP headers including Content-Type, when you upload objects. For more information, see Manage object metadata.
After you upload an object to OSS, you can send a callback request to a specified application server by using upload callbacks. For more information, see Upload callback.
We recommend that you upload files directly from your client to OSS. This solution accelerates uploads and reduces the resource usage of the application server by eliminating the need to transfer objects to and from the application server. For more information, see Overview.
You can compress the image that you uploaded and configure custom styles for the image. For more information, see IMG implementation modes.
If you need to obtain the image size after an image is uploaded, you can specify
?x-oss-process=image/info
to query basic information about the image. For more information, see Query the EXIF data of an image.If you want to perform operations, such as recognizing text, extracting subtitles, transcoding, and generating thumbnails, on uploaded images or videos, see Functions and features.
You can add signature information to the URL of an uploaded object and share the signed URL to allow third parties to access the object. For more information, see Add signatures to URLs.
When you access an object by using the URL of the object, whether the object is previewed or downloaded is determined by the type of the domain name and the creation time of the bucket that stores the object. For more information, see What do I do if an image object is downloaded as an attachment but cannot be previewed when I access the image object by using its URL?