I am using a form to upload multiple files. I have the following:
<input id="files" name="files[]" type="file" value="Add files..." multiple/>
<input id="addfiles" value="Add" type="button"/>
and
$("#addfiles").click(function() {
f = $("#files").prop("files");
for (index = 0; index < f.length; ++index) {
if (!is_in_queue(f[index]))
{
queue.push(f[index]);
[...]
How can I compare two File
objects? I need this comparison for is_in_queue
. Unfortunately I see only the name
attribute is set, but not the path (it's empty). That means a name
-based comparison would fail for files with identical names in different paths.
Update: ideally I'd like this to be done client-side. The user needs to set some parameters for each uploaded file before uploading, and I'd like to avoid duplicating this workload.