In vue.js to send a file that it came in $_FILES?

How do I send a file to the data were not included in php://input and was accessible directly from $_FILES?
Or $_POST Request when sending data, they are not available in the $_POST array, and yet again, in php://input
Please tell me, how am I supposed to get around?

Now the code for sending files like this:
the <script>
 new Vue({
 el: '#app',
 data: {
 files: []
 methods: {
 onFileChange: function(e) {
 var files = || e.dataTransfer.files;
 if (!files.length)
 createImage: function(file) {
 var reader = new FileReader();
 var vm = this;
 reader.onload = function(e) {
 vm.image =;
 upload: function(){'/file', {image: this.image}})
 .then(function(res) {
June 14th 19 at 20:53
1 answer
June 14th 19 at 20:55
use FormData

Something like that happens:

let data = new FormData();
data.append('file', thi.image);'/file', data)
 .then(function(res) {
Thank you:) - Golda commented on June 14th 19 at 20:58

Find more questions by tags PHPVue.js