Connexion
Applications Google
Menu principal
Post a Comment On:
Brillian Solution
"How to Display Image in File Upload"
No comments yet. -
1 – 0 of 0
[Image] How to Display Image in File Upload This is simple trick how to display image in file upload before upload to server.
Html <form id="form1" runat="server">
<input type='file' id="imgInp" />
<img id="blah" src="#" alt="your image" />
</form>
Javascript
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$("#imgInp").change(function(){
readURL(this);
});
Try this sample here
posted by Brillian Musyafa at
3:58 PM
on Feb 23, 2017
Leave your comment
You can use some HTML tags, such as
<b>, <i>, <a>
Choose an identity
Google Account
You will be asked to sign in after submitting your comment.
Name/URL
Comment with your Google account if you’d like to be able to manage your comments in the future. If you comment anonymously, you won’t be able to edit or delete your comment.
Learn more
Name
URL
Anonymous
Comment with your Google account if you’d like to be able to manage your comments in the future. If you comment anonymously, you won’t be able to edit or delete your comment.
Learn more
Please prove you're not a robot
"How to Display Image in File Upload"
No comments yet. -