0

I am trying to attach files and try to store them in an array. I have defined a function on a button which removes the file from array. Now if i attach a file named file1.txt , it gets stored in array and when i click on remove button this file gets removed from array. If i try to attach the same file again, the function(in ng-change ) which stores the file in arrray is not called but gets called if file is different than before(like file2.txt). I tried making a directive but gets the same problem. However I made a directive for drag and drop which solves the problem but i need both modes.

Siddharth
  • 6,966
  • 2
  • 19
  • 34
  • 1
    Can you share your code? It's super hard to help you without seeing any code. (please [edit](http://stackoverflow.com/posts/29983282/edit) your question to include it). – Wai Ha Lee May 01 '15 at 08:00
  • Sorry But i cant share the code. However i found the solution by setting the value of input field null. – Siddharth May 04 '15 at 09:02

1 Answers1

0

This is answered here: How to detect input type=file "change" for the same file?

But this breaks the cancel button (for Chrome at least), as it will not fire change event to null.

Community
  • 1
  • 1