Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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

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));
Comment

PREVIOUS NEXT
Code Example
Java :: Get the last Friday of a month in Java 
Java :: How to swap two values in Java using a supporting method? 
Java :: android studio breakpoint not working 
Java :: how to add an image to a gui in java windowbuilder 
Java :: java stream limit items 
Java :: simple login password and username java 
Java :: java get date in utc 
Java :: How to count the number of islands (groups of adjacent 1s) in a grid of 1s (land) and 0s (water), in Java? 
Java :: string to string array java 
Java :: who created java 
Java :: java stream distinct by atribute 
Java :: how to get data from combobox in java 
Java :: java 8 map foreach 
Java :: java join two list 
Java :: how to print an array in java 
Java :: java add to map 
Java :: java convert a string to char[] 
Java :: declaration of double array in java 
Java :: assert throws exception java 
Java :: java get JComboBox value 
Java :: sum of list java 
Java :: abstract class in java 
Java :: reverse int array java 
Java :: how to remove null values collections 
Java :: sort a string array java 
Java :: java store hexadecimal value 
Java :: synchronized java 
Java :: binary to decimal in java program 
Java :: java  
Java :: how to delete character in string java 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =