uploading pdf file or doc with crud function not working
usmanbasharmal123 opened this issue · comments
usmanBasharmal commented
I am trying to upload a pdf or doc file edit it again and delete function but I could not find the way if you could help me with
Leonardo Marques commented
@usmanbasharmal123 https://www.npmjs.com/package/object-to-formdata
import { objectToFormData } from 'object-to-formdata';
methods: {
save () {
this.form.post('/essays', {
transformRequest: [function (data, headers) {
return objectToFormData(data)
}],
onUploadProgress: (e) => {
}
})
.then((result) => {
console.log("Ok")
})
},
}
Example : https://github.com/cretueusebiu/vform/blob/master/example/upload.html