Item from the list of selected files in the input is not removed

Asked

Viewed 86 times

0

Guys, I use the codes from the link below to make a list of files I selected from an input type "file". So far, so good. When you remove an item from the list, apparently everything happens smoothly. Maaaaas... When files are uploaded to the server, the item that has been removed continues to be uploaded.

http://jsfiddle.net/ivanferrer/yrvyf2gn/

Any idea how to fix this?

1 answer

0

The reason this is happening is that you are only removing the item from DOM that you created, just the line with the thumbnail and the file name, you are not removing the file from the value of <input type="file" />.

I did a research on the subject and this value returned by the Html5 api is a FileList which actually has nothing to list, is an object, and that object is readonly.

Sources:

  • I get it. But there’s some way around that in this model that I’m using?

  • I’ve already done something like that using Angularjs, jquery no. I’m looking for a solution. As it was not something quick to find I left the quick answer on the subject.

  • It’s worse that I’m having a certain headache with it and looking for some solution. Because of the doubts, if you still have this option with Angularjs, could make available, by courtesy?

  • I come up here another time, doing a deploy here and this code when I did me and God understood him, now just God hahaha I’ll have to stop to read it because it’s from a project of my old job and has some treatments on it.

  • Kkkkkkk. All right.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.