let data = new FormData(); for (var i = 0; i < files.length; i++) { let file = files.item(i); data.append('images[' + i + ']', file, file.name); } const config = { headers: { 'content-type': 'multipart/form-data' } } return axios.post('/api/images', data, config)