I have a form with two file upload fields. When you handle files uploaded through HTML with PHP normally, you get a $_FILES array with a bunch of entries like $_FILES['name'], $_FILES['tmp_name'], etc. that contain all the file information.
I'd like to be able to get all of that information with jQuery. Simply doing $('[name="textfile1"]').val() just gives me C:/fakepath/test.txt if I upload test.txt. Is there a way to get the actual array of information? I have a bunch of text input fields along with the file upload fields and I want to be able to pass all the information at once with an AJAX call.
<form action="" method="post" enctype="multipart/form-data">
<div class="input">
<p>Upload the sitelist (.txt files only):</p>
<input style="margin-top:0;margin-bottom:6px" type="file" name="textfile1" /><br />
</div>
<div class="input">
<p>Upload the dictionary (.txt files only):</p>
<input style="margin-top:0;margin-bottom:6px" type="file" name="textfile2" /><br />
</div>
</form>