const upload = async (request, response, next) => {
const { files } = request;
if (!files) {
response.status(400).send({ message: "No file uploaded." });
return;
}
}
Am I missing something here?
const upload = async (request, response, next) => {
const { files } = request;
if (!files) {
response.status(400).send({ message: "No file uploaded." });
return;
}
}
Am I missing something here?
Looks like it could be as simple as using capitalized File instead of file for the key name of the file upload in Body. If that doesn't work, try inspecting the whole request to see if your middleware is putting the files on a different key in the request object.