Trying to upload a image to azure storage blob But the fetch method doesn't works
It works properly in postman but shows error in fetch
Not problem in heroku deployment
What is the problem in this code
This is the code i have tried :
const uploadImage = async () => {
try {
const Data = new FormData();
Data.append('file', image);
console.log("form data", Data);
await fetch('https://fame-azure.herokuapp.com/aa', {
method: 'POST',
body: Data
})
} catch (err) {
console.log(err);
}
code in backend :
app.post('/aa', upload.any(), function (req, res, next) {
console.log(req.files)
res.send('ok')
res.status(200).send('Uploaded: ' + req.files)
})