I'm trying to upload images to my server using node and React, however, when I try to upload, it generates this message to me:
Not allowed to load local resource: file: /// C: / fakepat: 3000 / record / 1h / pastedImage.png
I can not understand what it might be, anyone to help me?
React
handleAdd() {
const id = this.state.id;
const image = this.state.image;
const description = this.state.description;
const patient = this.state.patient;
if (id === '') {
axios.post(URL, { image, description, patient })
.then(resp => this.refresh());
} else {
axios.put('${URL}/${id}', { image, description, patient })
.then(resp => this.refresh());
}
}
Node
router.post('/', async(req, res, next) => {
try {
var record = new Record({
image: req.body.image,
description: req.body.description,
patient: req.body.patient
});
await record.save();
res.status(201).send({
message: 'Cadastro efetuado com sucesso!'
});
} catch (e) {
res.status(500).send({
message: 'Falha ao processar sua requisição'
});
}
});