“Axios -Datei Upload” Code-Antworten

Axios -Datei Upload

const formData = new FormData();
const imagefile = document.querySelector('#file');
formData.append("image", imagefile.files[0]);
axios.post('upload_file', formData, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
})
Panicky Pollan

Axios senden Datei

var formData = new FormData();
var imagefile = document.querySelector('#file');
formData.append("image", imagefile.files[0]);
axios.post('upload_file', formData, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
})
Mattia

Datei axios hochladen

uploadFile: function (event) {
    const file = event.target.files[0]
    axios.post('upload_file', file, {
        headers: {
          'Content-Type': file.type
        }
    })
}
Bloody Beetle

Ähnliche Antworten wie “Axios -Datei Upload”

Fragen ähnlich wie “Axios -Datei Upload”

Weitere verwandte Antworten zu “Axios -Datei Upload” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen