feat: added 50MB file size limit to frontend and backend - #209
PrinceK-Git wants to merge 1 commit into
Conversation
|
Please do proper testing of all the possible cases properly before making a PR. I have attached an example of a case: Screen.Recording.2026-10-02.at.9.47.52.AM.movHere either don't allow the user to click submit untill the pond is free of wrong files, or fix the pond to upload only the correct files and ignore the wrong files and close automatically. Currently in this case the user has to refresh the page to upload again. According to me we should not allow the user to click submit untill pond is clear. If we handle it using the second approach then it might be possible that the user is uploading multiple files but a file which is below the correct files is faulty, and our pond just uploads the correct ones and ignores the wrong one. The user would think that all the files got uploaded successfully. But it is not true. Enhancements:
|
|
Also, you have removed the extra note which you had added and is visible in the screenshots: "Files require approval from BR....". Please keep it. Don't put it as a separate note, you can make it like: |
| import multer from "multer"; | ||
|
|
||
| export const upload = multer({ dest: "external/uploads" }); | ||
| export const upload = multer({ |
There was a problem hiding this comment.
No need to do this, the nginx layer will not let 50 MB+ size files to reach this point. Adding this would unnecessarily make the process slow and more prone to errors. Let's keep it simple. If in future we decide to modify the limit, we'll have to update in multiple places like in frontend, server, and nginx layer. So it is better to not over complicate things and keep it simple.
aditya-samal
left a comment
There was a problem hiding this comment.
From next time, please avoid including package-lock.json or any other files in the PR unless they are actually required for the changes being made.
Description: This PR introduces a strict 50MB file size limit for all file uploads to prevent users from uploading excessively large files. The restriction is enforced on both the client and server sides.
Changes Made:
Frontend (client/src/screens/contributions/index.jsx):
Backend (server/modules/contribution/contribution.routes.js):