You would use this instead of <input type='file'>. I haven't used this this component (or polymer / webcomponents in general) but it appears to be part of a component that wraps the File API <https://developer.mozilla.org/en-US/docs/Web/API/File>.
-T-Bone On Monday, September 15, 2014 3:47:51 PM UTC-4, David James wrote: > > I just looked over this nice presentation: > http://html5-demos.appspot.com/static/polymer/index.html#24 > > I have some questions about slide 24 "Everything is an element, read > files...using DOM". > > Here is the code from the slide: > > <polymer-file readas="dataurl"></polymer-file> > var pFile = document.querySelector('polymer-file'); > pFile.addEventListener('polymer-result', function(e) { > console.log(this.result); > }); > pFile.blob = new Blob(['abc'], {type: 'text/plain'}); // Set the file to > read > pFile.read(); > > This seems like madness; why use an *element* to read a file at all? Reading > a file is fundamentally an action. Wrapping up an action in a structural > element (intended for a UI) seems ill-conceived. > > Am I missing something? Perhaps polymer-file is *only*intended to > represent a file upload UI component? > Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/debe3504-64fd-48e8-b638-6d57bffcb637%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
