2

I have multiple file input. I select five files in it. Can i delete from this input 1 or 2 files and upload? fiddle

HTML:

<input type="file" id="files" name="files[]"  multiple="multiple" />

part of JS:

function handleFileDelete() {
    $(".thumb").on("click", function(){
        $(this).detach();
    })
}

I can delete preview, but how to delete value in input?

1
  • the fiddle seems to be incomplete. I don't see the elements with .thumb class Commented Oct 2, 2013 at 19:21

1 Answer 1

0

It appears that you cannot: Remove selected file(s) before upload with Javascript as FileList has no api call to remove an item.

However, there is an alternative suggestion here which may help you, it provides an implementation on how to "clear" the file list: https://stackoverflow.com/a/13351234/2469255

Hope this helps.

Sign up to request clarification or add additional context in comments.

3 Comments

Ok.. How about another solution - take value of multiple file input(3 images) and send it to 3 hidden file inputs(no multiple) one by one. Then clean multiple input. And do what i want with this hidden imputs - remove, copy.. etc. Question - how to take and write value of multiple file input one be one?
This or this way i can get names of files. But i think in my case it's useless..
@WaNgeL I am inclined to agree, without the underlying binary object there's not much you can do with it. .getAsBinary() is also obsolete now and as far as I can tell there's no (API) way of getting at it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.