Open abhijha0602 opened 1 year ago
I know this is late but if in your terminal it says: error: file is not defined, but in CONSOLE it says CORS error it is actually not the CORS causing the error it is the multer problem in the filename section filename: function (req, res, cb) { const uniqueSuffix = Date.now() + "-" + Math.round(Math.random() + 1e9); const filename = file.originalname.split(".")[0]; cb(null, filename + "-" + uniqueSuffix + ".png"); },
here just change the res to file:
filename: function (req, file, cb) {
const uniqueSuffix = Date.now() + "-" + Math.round(Math.random() + 1e9);
const filename = file.originalname.split(".")[0];
cb(null, filename + "-" + uniqueSuffix + ".png");
},
and it should works
everything connected successfuly but login and signup form is not redirecting to the any page after submiting the form it is giving cors error