Upload Converted Base64 To Image Object To Oss Without Saving

[Solved] Upload Converted Base64 To Image Object To Oss Without Saving | Swift - Code Explorer | yomemimo.com
Question : upload converted base64 to image object to oss without saving in java

Answered by : marsel-mori

String endpoint = "<yourEndpoint>";
String accessKeyId = "<yourAccessKeyId>";
String accessKeySecret = "<yourAccessKeySecret>";
String bucketName = "<yourBucketName>";
String yourImageName="this name of the image you want to upload";
String objectName = "this-is-path/" + yourImageName + ".png";
String bas64Img = "<base64 string>";
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
byte byteImg[] = Base64.decodeBase64(bas64Img);
ossClient.putObject(bucketName, objectName, new ByteArrayInputStream(byteImg));

Source : | Last Update : Thu, 26 May 22

Answers related to upload converted base64 to image object to oss without saving in java

Code Explorer Popular Question For Swift