[Vuejs]-Image does not uploaded in vue-codeigniter

0๐Ÿ‘

I think if you success get the send but without file, maybe your send type has error

For server Base64 is a String ,not a file(byte stream) ,for axios ,default send type is Application/json, and it only can not send a Byte Stream , so you should cheack your server can get a String and transform to file
But if your server want a file , you should use formData
And I suggest you use FormData to send file

Here is a examples for you if you want use axios send formData.

let formData = new FormData();
formData.append(photo,this.photo);
this.$axios({
  url: '/member',
  method: 'post',
  data: formData
});

Leave a comment