File input - Retrieving the file

Showing 1-8 of 8 messages
File input - Retrieving the file Andrew Joslin 5/7/12 7:44 AM
Hi,

I am having trouble getting the chosen file from a file input.

Here is the JSFiddle: http://jsfiddle.net/ADukg/11/

Nothing is shown when I pick a file.
Re: File input - Retrieving the file Marcello Nuccio 5/8/12 1:45 AM
File input type, is not implemented in angular [1]. You can use a dirty hack [2], or patch angular [3]. I do patch angular, but I don't know how to write tests for it :-(.

 [1]: https://github.com/angular/angular.js/issues/757
 [2]: http://jsfiddle.net/marcenuc/ADukg/49/
 [3]: https://github.com/angular/angular.js/issues/757#issuecomment-5242739

HTH
Re: File input - Retrieving the file Andrew Joslin 5/8/12 5:42 AM
HI marcello, thanks.  I'll probably use the hack for now.
Re: File input - Retrieving the file Marcello Nuccio 5/9/12 2:51 AM
Actually I've posted the wrong hack. Here's the cleaner one (IMHO):

    http://jsfiddle.net/marcenuc/ADukg/89/
Re: File input - Retrieving the file D. Zen 5/22/12 8:16 AM
Thanks Marcello,
  Here's an update to allow multiple files:


zen
Re: File input - Retrieving the file Marcello Nuccio 5/22/12 8:34 AM
Glad it helped... as I've said, the problem is: how to test it?

Actually, I'm using the patch [1], not the hack. The patch also supports `accept` attribute, with some quirks due to browsers differences... maybe we should use a custom attribute, for example `ng-accept`...
Re: [angular.js] Re: File input - Retrieving the file D. Zen 5/22/12 8:39 AM
I like the concept of a patch, but I would prefer it to be documented and rolled into the main branch.
In the meantime, this is an acceptable hack. If I get a chance, I will look at how to test your patch.

Thanks again,
zen

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/clreXOkbx3sJ.

To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.

Re: [angular.js] Re: File input - Retrieving the file David Brunner 5/25/12 8:44 PM
Marcello, Zen, this was extremely helpful.  Thank you very much for sharing your solution!

David