title: pass input file to background script
body: <p>I want to pass the input file from content page to extension background script, and then load it with <strong>FileReader()</strong> in the extension background script.</p>
  
  <p>So in the web page I have a <code>&lt;input type="file"&gt;</code> and from onchange event I pass the file from content script to background page like this:</p>
  
  <pre><code> var myfile = document.getElementById('fileid').files[0];
   chrome.runtime.sendMessage({myevent: "start", inputfile: myfile}, function(response) {});
  </code></pre>
  
  <p>in the background script I have this:</p>
  
  <pre><code>chrome.runtime.onMessage.addListener(function(message,sender,sendResponse){
  
     if(message.myevent==="start")
     {
        var reader = new FileReader();
  
           reader.onload = function(e) {
                // file is loaded 
           }  
  
  
         reader.readAsArrayBuffer(message.inputfile);
     }
  });
  </code></pre>
  
  <p>but FileReader not load it, I'm not sure if this is correct way , but all i need is to pass the input file element to background script and load it with FileReader to send it with HTTP POST from background script. Please tell me what is wrong or how to do it correctly. It will help a lot if I see a sample code, because I'm new to chrome extension development, and not so experienced.</p>