cretueusebiu / vform

Handle Laravel-Vue forms and validation with ease.

Home Page:https://vform.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uploading pdf file or doc with crud function not working

usmanbasharmal123 opened this issue · comments

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

@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