moses toh
moses toh

Reputation: 13172

How can I use formdata in upload file on vuetify?

I try like this : https://codepen.io/positivethinking639/pen/OJVRjGL?editors=1010

My code :

<v-form>
  <v-file-input multiple 
                v-model="documents"
                label="File input"></v-file-input>
  <v-btn color="success" @click="submit()">
    test
  </v-btn>
</v-form>

but it does not works

if I upload file and click button test, the formdata empty on the console

How can I solve this problem?

Upvotes: 0

Views: 1420

Answers (2)

Jeremy Walters
Jeremy Walters

Reputation: 2152

You can simple use the spread operator to view formdata. FormData is part of the XMLHttpRequest spec.

console.log(...formData);

Upvotes: 2

Pratik Patel
Pratik Patel

Reputation: 6978

You can't print formData directly on the console.

Try this.

// Display the key/value pairs
for (var pair of formData.entries()) {
    console.log(pair[0]+ ', ' + pair[1]); 
}

Codepen - https://codepen.io/positivethinking639/pen/OJVRjGL?editors=1010

Upvotes: 0

Related Questions