I have a webform that has an ASP file upload object and I want to use jQuery to grab the file they have selected and upload the file via AJAX.
However I am having problems grabbing the file name after it's been selected.
Here is the HTML/ASP Code:
<asp:FileUpload runat="server" ID="NewPic" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="NewPic" runat="server" Display="Dynamic" Text="You need to pick a picture." CssClass="mandatory"></asp:RequiredFieldValidator>
This is what I have tried but doesn't seem to work
uploadText = $('input[type=file]').value;
alert('FileName: ' + uploadText);