0

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?

2 Answers 2

2

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

console.log(...formData);
Sign up to request clarification or add additional context in comments.

Comments

0

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

6 Comments

I want to ask. What's the difference between sending using formdata and not using formdata?
formdata used when you want to send the file using Axios
I send the file using axios
I get reference that it only to add headers: {'Content-Type': 'multipart/form-data' }
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.