Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

upload byte array to oss

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 :: how to send a byte array in socket java 
Java :: why bufferedreader is faster than scanner 
Java :: How to iterate hashmap entries in java 
Java :: java max int value 
Java :: java print 2d char array 
Java :: get input in java using joptionpane 
Java :: java 8 find in list by property 
Java :: java cast int to string 
Java :: get driver mysql 
Java :: Who made java ? 
Java :: java list distinct by attribute 
Java :: string length solidity 
Java :: java get all directories in path 
Java :: remove last <br/ from string java 
Java :: string.join java 8 
Java :: all possible valid IP addresses leetcode 
Java :: java find all of letter in string 
Java :: java for increment by 2 
Java :: fhow to find location of java jdk 
Java :: JAVA Display Sum of n Natural Numbers 
Java :: maven paper 
Java :: java nested loop 
Java :: uppercase java 
Java :: how to remove null values in java 
Java :: java get relative path 
Java :: java base64 
Java :: AndroidManifest.xml could not be found. 
Java :: java long to double 
Java :: how to conver string to int 
Java :: set textview text android java 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =