0

I have

<input id="seleccion" name="archivos" multiple type="file" accept=".doc,.docx,.pdf" />

I need to delete one of the files (one by one)

function EliminaArchivo(item){
 $("#seleccion").vall(null);
}

this empties the input file completely and I need to delete only the file with the index that I'm passing as a parameter to my function.

file1 [0]    //here button for delete this file                                                                   
file2 [1]    //here button for delete this file                                    
file3 [2]    //here button for delete this file

i need remove file1 [1]...

rbahena_
  • 47
  • 9
  • that means you most likely have non-unique ids...make them unique...e.g. – Ctznkane525 Apr 30 '18 at 21:59
  • but is multiple selection my input – rbahena_ Apr 30 '18 at 22:00
  • https://stackoverflow.com/questions/32062876/removing-file-from-multiple-files-uploader-on-button-click-when-using-html5-file – Ctznkane525 Apr 30 '18 at 22:03
  • why do you need this ? do you need the remaining files list for some other computation ? – Muhammad Usman Apr 30 '18 at 22:08
  • This is for a page web. Where (users) they will select files to upload them to a server but, they will have the option of deleting some of their selected files if they wish, the example that you passed to me is very good, I was reviewing it, it is similar to what I need. – rbahena_ Apr 30 '18 at 22:18
  • you can't remove items from the actual `input.files` collection, but you can dupe the files to an array and splice that to use to the UI and server interaction. – dandavis Apr 30 '18 at 22:32

0 Answers0