93
rated 0 times
[
95]
[
2]
/ answers: 1 / hits: 8668
/ 4 Years ago, mon, november 23, 2020, 12:00:00
I'm following a tutrotial and all off a sudden i'm getting this error . I've tried all solution and reinstall module. but in other class the same code work
this is my code
import fileSaver from 'file-saver';
uploadPensiun(event) {
const files = event.target.files
const formData = new FormData()
formData.append('Pensiun', files)
fetch('http://localhost:5000/uploadpensiun', {
method: 'POST',
body: 'Pensiun',
headers: {
'Accept': 'application/json',
'Content-Type': 'multipart/form-data'
},
})
.then(res => res.json())
.then(data => console.log(data))
.catch((err) => console.log(err));
}
anyone can help me please?
More From » node.js