{"action":"created","issue":{"url":"https://api.github.com/repos/boxxxie/angularjs-imageupload-directive/issues/7","labels_url":"https://api.github.com/repos/boxxxie/angularjs-imageupload-directive/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/boxxxie/angularjs-imageupload-directive/issues/7/comments","events_url":"https://api.github.com/repos/boxxxie/angularjs-imageupload-directive/issues/7/events","html_url":"https://github.com/boxxxie/angularjs-imageupload-directive/issues/7","id":84120957,"number":7,"title":"inputImage does not trigger when same file is uploaded twice","user":{"login":"aptos","id":60274,"avatar_url":"https://avatars.githubusercontent.com/u/60274?v=3","gravatar_id":"","url":"https://api.github.com/users/aptos","html_url":"https://github.com/aptos","followers_url":"https://api.github.com/users/aptos/followers","following_url":"https://api.github.com/users/aptos/following{/other_user}","gists_url":"https://api.github.com/users/aptos/gists{/gist_id}","starred_url":"https://api.github.com/users/aptos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptos/subscriptions","organizations_url":"https://api.github.com/users/aptos/orgs","repos_url":"https://api.github.com/users/aptos/repos","events_url":"https://api.github.com/users/aptos/events{/privacy}","received_events_url":"https://api.github.com/users/aptos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-02T17:37:15Z","updated_at":"2015-06-06T01:28:20Z","closed_at":null,"body":"When I upload, then make some change to the file and click the inputImage element again, the file_upload_element \"change\" binding won't trigger. \r\n\r\nThis also became apparent when I added a cancel button which clears the model, ala: $scope.image=null. After I cancel, then try to upload the same file again nothing would happen.\r\n\r\nAs a fix, I set the file_upload_element value to null after processing in the inputImage directive:\r\n\r\n    file_upload_element.bind(\"change\", function (evt) {\r\n\r\n      <...snip...>\r\n\r\n      generic_image_processing_functions(files, attrs)\r\n         .then(update_model)\r\n         .then(function(){ file_upload_element[0].value=null; });\r\n      });\r\n\r\nI'm not sure this is the best fix, but it works for me."},"comment":{"url":"https://api.github.com/repos/boxxxie/angularjs-imageupload-directive/issues/comments/109494969","html_url":"https://github.com/boxxxie/angularjs-imageupload-directive/issues/7#issuecomment-109494969","issue_url":"https://api.github.com/repos/boxxxie/angularjs-imageupload-directive/issues/7","id":109494969,"user":{"login":"boxxxie","id":440034,"avatar_url":"https://avatars.githubusercontent.com/u/440034?v=3","gravatar_id":"","url":"https://api.github.com/users/boxxxie","html_url":"https://github.com/boxxxie","followers_url":"https://api.github.com/users/boxxxie/followers","following_url":"https://api.github.com/users/boxxxie/following{/other_user}","gists_url":"https://api.github.com/users/boxxxie/gists{/gist_id}","starred_url":"https://api.github.com/users/boxxxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boxxxie/subscriptions","organizations_url":"https://api.github.com/users/boxxxie/orgs","repos_url":"https://api.github.com/users/boxxxie/repos","events_url":"https://api.github.com/users/boxxxie/events{/privacy}","received_events_url":"https://api.github.com/users/boxxxie/received_events","type":"User","site_admin":false},"created_at":"2015-06-06T01:28:20Z","updated_at":"2015-06-06T01:28:20Z","body":"I'll accept a pr. \r\nthis directive is experimental. \r\nI think it may be better to use plupload or some other library that has been worked on more. "}}