HTML
<input
type="file" class="upload" onchange="readURL(this)" id="file" accept="image/x-
png,image/jpeg" />
<input
type="button" value="Upload" class="btn btn-default" style="margin:auto;display:block" onclick="checksize(this)" />
Java Script
Get File Name in
JavaScript:
document.getElementById('file').files[0].name
Get File Size in
JavaScript: