leon/angular-upload — pull request #12 by sdenier (2014-01-20 10:49:41+00:00)
Title: Possible fix for upload-button directive with IE9 and Webkit

The upload-button directive did not work with Webkit browsers (Chrome/Safari) and IE (9 at least).

The transparent file input was not positioned above the button for these browsers, so clicking on the button would do nothing. The transform rule was missing in the style but, at least for IE, it would require more work to be correcly styled.

```css
-webkit-transform: translate(-300px, 0) scale(4);
-ms-transform: translate(-300px, 0) scale(4);
```

Instead, I propose to use a label element linked to the input file. Accessibility feature makes it work on all major browsers (not tested with IE6/7/8 though). Clicking the label pops up the file input.

- I use `display: none` to hide the file input and did not have any problem. However, I kept the previous css style in comments just in case
- Also fix uploadButton directive: test for fileInput.files existence before testing its length (fix for IE9 and below, which do not have a files attributes)

Note: this follows PR https://github.com/leon/angular-upload/pull/11 but is actually independant. So it can be cherry-picked.