I have a file input control
and button
as below:-
<input type="file" name="Resume" id="upload"></input>
<input type="button" id="btnSave" value="Save" onclick="sample()"></input>
Also a function called as sample()
<script type="text/javascript">
function sample(){
var file =$('#upload')[0].files[0];
alert(file);
}
</script>
The above function is called on a click of button btnsave
.
Issue
:Does not return a alert with [object File]
, inspite of file exist in file input control.
Note: I am using I.E 11
and also loaded Jquery library.
file
variable is defined somewhere. – Kartikeya Khosla