Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the list of files currently attached to the <input> element

I am wrapping some jQuery functionality around jQuery File Upload plugin. It uses an <input type="file" name="files[]" multiple="multiple"> element to what it seems like "hook up" the selected files before the upload. When a form on which the input resides is submitted, files are parsed on the server.

In order to debug my UI, I need to see the list of files currently "attached" to the input. Is it possible with Firebug or Chrome debugger?

like image 342
Maxim V. Pavlov Avatar asked Mar 22 '12 16:03

Maxim V. Pavlov


2 Answers

Yes, you can just use the console and jquery:

$("#idofinput")[0].files

Then just treat it like an array of files :)

like image 103
Justin Pihony Avatar answered Oct 14 '22 18:10

Justin Pihony


This is how you can check in console:

$("#idofinput").get(0).files
like image 39
romelmederos Avatar answered Oct 14 '22 20:10

romelmederos