title: Posting image to laravel with Axios only passing [object file] as string
body: <p>I have a react app that is the frontend for a laravel application. I am using a simple image uploader that returns the uploaded file to a post route. In the controller for the post route the request is coming in as a string and not the actual object. see my code.</p>
  
  <pre><code>onUpload = (picture) =&gt; {
      this.setState({
          pictures: this.state.pictures.concat(picture),
      });
  
      var curr = this
  
      const formData = new FormData();
      formData.append('file',picture)
           console.log(picture[0])
  
          axios
          .post('/upload-subitem-image', formData, fileHeaders)
          .then(function (response) {
  
              const data = response.data
  
                      console.log(data)
  
          })
          .catch(error =&gt; {
              console.log(error);
          })
  }
  </code></pre>
  
  <p>When i console the picture object I get</p>
  
  <pre><code>File {name: "test.png", lastModified: 1553443959805, lastModifiedDate: Sun Mar 24 2019 12:12:39 GMT-0400 (Eastern Daylight Time), webkitRelativePath: "", size: 11695, …}
  </code></pre>
  
  <p>But after passing it to laravel to try and get the file it returns a string when i try to do this.</p>
  
  <pre><code> $data = $request-&gt;File();
  </code></pre>
  
  <p>and looks like</p>
  
  <pre><code>{file:{"[object file]"}
  </code></pre>
  
  <p>Headers look like this:</p>
  
  <pre><code>const fileHeaders = {
  'X-CSRF-TOKEN' : document.querySelector('meta[name="csrf-token"]').getAttribute('content'),
  'content-type': 'multipart/form-data',
  'Accept': 'application/json',
    }  
  </code></pre>