Do validation with file mimetype? #301
Unanswered
SupertigerDev
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Interestingly if i do it like this, it works: if (!isValidMime) {
field.file.stream.on("readable", () => {
res.status(400).json({
error: "Invalid image mime type",
});
})
return;
} If this is a good way, please let me know |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I do this mimetype validation check, there are different things happening on windows and linux.
On Windows: the request responds only sometimes, and other times it times out.
On Linux: It doesnt seem to be working at all, it always times out.
The console log "test" is ran on both systems. just the request is not ending for some reason.
Beta Was this translation helpful? Give feedback.
All reactions