Object upload-download and management
Does BOS support custom file attributes?
BOS supports both system and custom Meta fields. System Meta stores essential metadata managed by BOS (e.g., Content-Length, Last-Modified). Custom Meta consists of <key,value> pairs prefixed with "x-bce-meta-", allowing you to store additional attributes, such as x-bce-meta-owner: xiaoming.
How to update Meta information, such as Content-type?
You can update metadata by using the CopyObject method. Set the destination file to match the source and include the metadata fields you wish to add or modify. Additionally, the Meta configuration feature in the console will soon enable updates to metadata (like Content-Type) directly via the console interface.
How to share files?
BOS supports file sharing by getting links to object files. For private buckets, you can generate a time-limited temporary sharing link via the console or SDK. To generate sharing links via console, see [Download Object](BOS/Console Operation Guide/Manage object/Download file.md). To generate temporary sharing links via SDK, refer to Java SDK's [Get Object URL](BOS/SDK/Java-SDK/File management.md#Get object URL).
What's the difference between such upload APIs: PutObject, PostObject, AppendObject, and MultipartUpload ?
These upload APIs can all handle file uploads. Their main differences are detailed below:
- PutObject is generally used to upload small files.
- PutObject is especially suitable for uploading files in a browser-based environment.
- AppendObject is designed for incremental upload scenarios, such as real-time uploads of surveillance videos or log files. Appendable files can be accessed and viewed at any time.
- MultipartUpload is intended for uploading large files. This method involves splitting a large file into parts and uploading each part separately, thereby enhancing both the success rate and the upload speed. Note that files uploaded using MultipartUpload will not be viewable in ListObjects until the entire upload process (commit) is completed.
Does CopyObject support cross-Region copying?
CopyObject supports cross-region copying of objects. When performing cross-region object replication, cross-region traffic fees will be charged for the generated traffic. Refer to [Product Pricing](BOS/Product pricing/Product price/Pay-As-You-Go Charge Type.md) for cross-region fee standards.
How to copy data across buckets?
The API supported by [BOS Copyobject](BOS/API Reference/Object-Related Interface/Basic Operations/CopyObject.md) can realize the data copy. In order to facilitate your use, BOS console, CLI and SDK are encapsulated such APIs. When you need to copy a large number of files across buckets, you can make it through SDK. First, get the list of files to be copied from ListObject, and then copy with CopyObject. It shall be noted that, you need to have the read permission for source files and write permission for target files in order to execute CopyObject. If the target bucket is owned by another user, you can ask the owner to set ACL for his/her bucket to allow you for writing. For more details, refer to [Bucket Access Control](BOS/API Reference/Access control.md#Bucket permission control).
How to upload large files?
BOS supports various file upload methods, including Data Transmission Service (or Data Import, also known as "hard drive mailing"), CLI, SDK, and the Management Console.
- When dealing with a large number of files where network upload is impractical, we recommend using the Data Import Service. The Data Import Service enables rapid data import via mailed hard drives. If interested, submit a Ticket for consultation.
- If the number of files is moderate or upstream bandwidth conditions are favorable, you can consider using CLI for file uploads. The CLI supports resumable upload for large files. For CLI upload instructions, refer to BCE CLI. The CLI is encapsulated based on the BOS Python SDK. If you need to upload files in other programming languages, you can also write upload code using the [BOS SDK](BOS/SDK/Java-SDK/File management.md#Overview).
- If you have only a few files, you can upload them directly through the Management Console.
How to batch delete files in BOS?
BOS offers multiple options for batch file deletion.
- Log in to the console, select multiple files, and delete them in batches.
- BOS provides a batch deletion API, that is [DeleteMultipleObjects API](BOS/API Reference/Object-Related Interface/Basic Operations/DeleteMultipleObjects.md), which allows deleting multiple objects under the same bucket with a single HTTP request.
- Batch deletion can be performed using the BOS CMD tool. For detailed instructions, refer to Delete Object.
How to quickly check whether a file exists in a bucket?
You can use the ListObjects API for iterative checking.
Does BOS support resumable upload?
When using the console to upload files, resumable uploads are not supported. However, APIs, SDKs, and tools provided by BOS support resumable uploads.
How to change standard BOS to infrequent access BOS?
Lifecycle management can convert storage class from standard storage to infrequent access storage. BOS lifecycle rules take effect within one day after configuration. After the rules take effect, BOS will process eligible objects accordingly, but the processing requires some time (usually several hours), so the results may not be immediately visible after configuration of the rules. The time calculated in the rules (i.e., the "age" of an object) is based on the object's creation time, not the creation/modification time of the lifecycle rule. BOS only stores the last modified time of files, i.e., the last-modified time. If Meta is not updated or files are not overwritten, the last-modified time will be the creation time. Therefore, the "creation time" in the lifecycle is actually the last-modified time. For detailed operation methods, refer to Manage Lifecycle.
How to upload/download files or folders in BOS?
BOS supports the following methods for file upload:
- Directly Upload Object via the console.
- Use API or SDK for upload/download. For folder uploads, refer to Simulate Folder Function;
- Use Peripheral Tools for upload/download. Uploading folders on Windows systems can be achieved using the BOS Desktop tool.
The console can handle uploads of up to 5 GB in size. For batch transfers or files larger than 5 GB, it is recommended to use SDKs or other supported tools.
How to configure file Header attributes?
You can use the CopyObject API for configuration. The CopyObject API can only modify userMeta; you need to configure the content-type during upload.
Is browser-based file upload supported?
You can use the bce bos uploader tool. For detailed operations, refer to Web-Side Direct Upload Practice.
Can accidentally deleted data in BOS be recovered?
Users can configure the bucket trash function to ensure that deleted data remains in the bucket trash, facilitating the subsequent recovery of deleted data. By default, the recycle bin function for buckets is disabled. For details, see [Recycle Bin](BOS/Console Operation Guide/Managing Bucket/Set bucket trash.md).
How to configure direct object browsing instead of downloading?
If you want to configure BOS resource access for viewing rather than direct downloading, you can specify it through object Meta configuration. For details, refer to Configure Object Meta.
Can BOS automatically perform MD5 verification after file upload?
If you want to verify the integrity of uploaded files, you can use the content_md5 parameter in the API for file data verification. After setting, BOS will enable file content MD5 verification, compare the MD5 you provide with the MD5 of the file, and give an error prompt if they are inconsistent. For detailed description, refer to PutObject API. When using multipart upload, it is recommended to use the Content-MD5 value returned by BOS for each part to verify the correctness of uploaded part data. When all part data is combined into one Object, it no longer contains the MD5 value.
All BOS-provided SDKs support MD5 verification. For example, in JAVA, detailed descriptions can be found in File Management.
How can BOS obtain thumbnails?
Users can generate thumbnails using [Video Frame Capture Function](BOS/Data Cube/Video processing/Video frame capture.md) provided by BOS. You can also use VOD to obtain covers. For specific APIs, refer to Query Specified Media Assets.
How to retrieve both User and Meta information of an object in the ListObjects API?
If you want to batch retrieve User and Meta information of an object, you can use the GetObjectMeta API.
Can BOS object addresses use custom domain names?
You can bind a custom domain name to the bucket for access. For detailed operations, refer to [Bind Bucket Domain Name](BOS/Console Operation Guide/Data Publishing/Creating a Bucket Custom Domain Name.md).
How to incrementally upload files to BOS?
In Baidu AI Cloud Object Storage (BOS), incremental data migration and backup can be performed via:1. BOS peripheral tools, such as using sync in Bcecmd for data migration and backup. Bos Desktop provides Local Directory Data Migration and Backup function;2. Mirror Back-to-Origin: File resources can be accessed via the bucket domain name. If a file doesn't exist, it will be fetched from the origin and stored in the bucket.
Does BOS image processing support dots in style definitions?
Not supported. Refer to image style name restrictions: Rules and Limitations
Can BOS obtain video preview thumbnails after uploading videos?
Baidu AI Cloud Object Storage (BOS) cannot automatically extract frames from uploaded video files to generate thumbnails. You can use Multimedia Cloud Transcoding (MCT), which can create thumbnail tasks to generate thumbnails.
Does BOS video links support parameter addition similar to image processing for data retrieval?
The Baidu AI Cloud Object Storage (BOS) Service currently supports data processing for audio and video resources. For details, refer to: Multimedia Cloud Processing.
What fees will be incurred when I upload files to BOS?
The charge items of BOS service include four parts: Storage Fees, Traffic Fees, Request Fees, and Data Processing Fees. Depending on your usage, each item will incur different fees.
Can MP4 files be previewed? The file information has a preview function. How to achieve screenshot previews for MP4 files?
It can be combined with video processing to extract the first frame or specified frames from a video file to generate corresponding cover images for preview. For details, refer to Multimedia Cloud Processing.
Does BOS, which stores resources like images/videos, have an API to query video Meta information such as video dimensions and related details?
Baidu AI Cloud Object Storage (BOS) does not support querying video dimensions. To acquire this information, use third-party tools like ffprobe to analyze the video through its BOS URL.
Is it possible to retrieve the duration of video files in a bucket?
Currently, BOS does not provide an API to retrieve the duration of video files. For this purpose, third-party tools like ffprobe are recommended.
How to upload files to a specified subdirectory in a Bucket using baidubce-sdk or bce-bos-uploader?
The corresponding resource folder can be specified through the object key. For instance, if the object is "temp/abc.jpg," it refers to an abc.jpg file located under the temp directory.
There are too many items in Standard Storage, how to delete them?
You can batch delete resources using the following methods:
- Use BOS lifecycle for automatic deletion of resources matching the rules. For details, refer to: Manage Lifecycle
- Use BOS peripheral tools for batch deletion, such as bcecmd. For details, refer to: Delete Object
What to do if BOS bandwidth is insufficient, causing slow image loading during high traffic?
Currently, BOS sets a bandwidth cap of 10 Gbit/s for a single bucket, which is generally sufficient to handle high request volumes. Slow loading is often due to the client's network bandwidth. Testing in an alternative network environment can be helpful. Furthermore, to enhance BOS resource loading, you can utilize CDN to cache resources on CDN nodes, offering better performance compared to directly requesting resources from BOS.
