Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
58
rated 0 times [  65] [ 7]  / answers: 1 / hits: 61845  / 9 Years ago, fri, may 8, 2015, 12:00:00

I need to set the img src property from a byte array that I have in a Object.



<img id=profileImage>
<spring:bind path=object.profilePicture>
<input type=file name=profilePicture id=profilePicture path=profilePicture>
</spring:bind>


I need to display that byte array in the img above the input tag.


More From » java

 Answers
21

Replace the jpg with the type of image, and [your byte array] with your byte array. You need to convert it to base64 if it isn't already.



<img id=profileImage src=data:image/jpg;base64, [your byte array]>

[#66671] Thursday, May 7, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brittanye

Total Points: 263
Total Questions: 94
Total Answers: 115

Location: Burkina Faso
Member since Thu, Dec 23, 2021
3 Years ago
brittanye questions
Mon, Aug 10, 20, 00:00, 4 Years ago
Tue, Jun 16, 20, 00:00, 4 Years ago
Wed, Apr 22, 20, 00:00, 4 Years ago
Mon, Apr 13, 20, 00:00, 4 Years ago
;