Performing a File-Based Upload
If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference
File-based upload uses local files as the data source of objects. Sample code is as follows:
String endPoint = "https://your-endpoint";
String ak = "*** Provide your Access Key ***";
String sk = "*** Provide your Secret Key ***";
// Create an instance of ObsClient.
ObsClient obsClient = new ObsClient(ak, sk, endPoint);
obsClient.putObject("bucketname", "objectname", new File("localfile")); // localfile indicates the path of the local file to be uploaded. You need to specify the file name.
The file to be uploaded cannot exceed 5 GB.
Last Article: Performing a Streaming Upload
Next Article: Obtaining Upload Progresses
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.