Thursday, July 23, 2015

JQuery - get input file type file info name size type last modified date

<input name="imageUpload" id="imageUpload" type="file" value="" class="text"/>
<input name="submit" type="submit" id="submitForm" value="Submit Photo" />

$('#submitForm').bind("click",function() {

    var imgVal = $('#imageUpload').val();
    var file = $('#imageUpload')[0].files[0];

    console.log(imgVal);
    console.log(file);

    return false;
});

No comments: