title: Ember.js: Upload file component
body: <p>I need to create an Ember component to select a file.
  My page will include multiple "upload component"</p>
  
  <p>I have read a post trying to implement that: (<a href="https://stackoverflow.com/questions/9200000/file-upload-with-ember-data/">https://stackoverflow.com/questions/9200000/file-upload-with-ember-data</a>) BUT the UploadFileView is directly linked to the controller.
  I would like to have something more generic... </p>
  
  <p>I would like to remove the App.StoreCardController.set('logoFile'..) dependency from the view or pass the field (logoFile) from the template...</p>
  
  <p>Any idea to improve this code ?</p>
  
  <pre><code>   App.UploadFileView = Ember.TextField.extend({
      type: 'file',
      attributeBindings: ['name'],
      change: function(evt) {
        var self = this;
        var input = evt.target;
        if (input.files &amp;&amp; input.files[0]) {
          App.StoreCardController.set('logoFile', input.files[0]);
        }
      }
  });
  </code></pre>
  
  <p>and the template:</p>
  
  <pre><code>{{view App.UploadFileView name="icon_image"}}
  {{view App.UploadFileView name="logo_image"}}
  </code></pre>