title: Can't upload a file with protractor
body: <p>I'm having no luck uploading a file with protractor. Just need to fill out a simple form and click a submit button, which then posts the form to a different url:</p>
  
  <pre><code>  it('can upload file', function(){
      var fileToUpload = './example.txt',
          absolutePath = path.resolve(__dirname, fileToUpload);
          file = element(by.css('input[type="file"]'));
  
      element(by.css('input[type="file"]')).sendKeys(absolutePath);
      element(by.css('button[type="submit"]')).click().then(function(){
          console.log('button clicked');
      });
  
  });
  </code></pre>
  
  <p>Here's the form markup:</p>
  
  <pre><code>&lt;form enctype="multipart/form-data" method="post" action="/upload" class="upload ng-pristine ng-valid"&gt;
      &lt;input type="file" name="file" class="file"&gt;
      &lt;button type="submit" value="Import"&gt;Upload&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>It appears from watching the test run that the input is filled in and the submit button is clicked, but then instead of posting the form to the proper url: </p>
  
  <pre><code>http://localhost/upload 
  </code></pre>
  
  <p>Chrome appears to navigate to that url but just says "The webpage is not available" in the test window. Submitting the form manually works, the post to /upload works as expected and give you a confirmation message. </p>
  
  <p>What I want to do is just wait for the upload to process and write another test to check the confirmation message, but I can't seem to get this far. What am I missing here?</p>