title: How to append files and data to FormData in vue.js
body: <p>I'm trying to append uploaded file and a data value to FormData in vue.js. In my controller, only the files request can be assessed.</p>
  <pre class="lang-js prettyprint-override"><code>data() {
    return (
      file: '',
      categ: ''
    }
  }
  </code></pre>
  <p>And in my method:</p>
  <pre class="lang-js prettyprint-override"><code>var form = new FormData();
  var file = this.file;
  var cat = this.categ;
  form.append('pics', file, cat);
  
  axios.post('/api', form, { headers:
    { 'Content-Type': 'multipart/form-data' }
  }).then (res =&gt; console.log(res));  
  </code></pre>
  <p>What am I doing wrong?</p>