title: Dealing with file objects in Angular 2
body: <p>I have asked a question based on this before but no solutions have worked for me and now I'm completely lost. </p>
  
  <p>I want to be able to upload an image and have it save to the assets folder of my Angular 2 project. </p>
  
  <p>At the moment I have the file object but I can't figure out what to do with it next or how I should go about saving it.</p>
  
  <p>Here is my input field for the file</p>
  
  <pre><code>&lt;input type="file" name="image" (change)="saveImageToFile($event)" accept="image/*" required&gt;
  </code></pre>
  
  <p>Here is the function that deals with that file:</p>
  
  <pre><code>saveImageToFile(e) {
     this.image = e.srcElement.files[0];
     console.log(this.image);
  }
  </code></pre>
  
  <p>This logs the image object but I don't know how to go about saving it. I have tried setting up a form data object but when I try to append the file to it, it is still empty. I have a Java/Spring-boot back-end but I can't even get it to send to the back-end.</p>