img src data base64
<img src="data:image/png;base64,..." /> <!-- Replace png with the mime type of the image --!>
img src data base64
<img src="data:image/png;base64,..." /> <!-- Replace png with the mime type of the image --!>
uploading base64 image
// Create a source file client
ShareFileClient dirClient = new ShareFileClientBuilder()
.endpoint("https://xxx.file.core.windows.net")
.shareName("xxx")
.credential(new StorageSharedKeyCredential("xxx", "xxx"))
.resourcePath("photos" + "/" + "test.png")
.buildFileClient();
var base64Image = "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
// Create a source file
try {
var sizeInBytes = 4 * Math.ceil(base64Image.length() / 3)*0.5624896334383812;
dirClient.create((long) sizeInBytes);
} catch (ShareStorageException e) {
System.out.println("Failed to create source client. Reasons: " + e.getMessage());
}
// decodeBase64
byte[] bytes = Base64.decodeBase64(base64Image);
// Upload
try (ByteArrayInputStream dataStream = new ByteArrayInputStream(bytes)) {
dirClient.upload(dataStream, bytes.length);
} catch (IOException e) {
e.printStackTrace();
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us