Different file size limitation based on file type
See original GitHub issueI have an endpoint to upload files. I would like to have different file size limits depending on the file type. Images size limit =< .5 MB and PDF size limit =< 2MB.
The limits.fileSize
options only allows for one value, and I can’t do it in the fileFilter
property either… So how could I do it?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Set different max upload size limits based on file type/extension
I'm asking for a way to have multiple limits for the Max upload file size field based on the uploaded file extension. Thank...
Read more >Maximum File Size - an overview | ScienceDirect Topics
As designed, the maximum NTFS file size is 16 EB (16 × 1024 6 or 2 64 bytes). As implemented, the maximum NTFS...
Read more >Allowed File Types and File Size Limits - Princeton Site Builder
Depending on the the type of file you are uploading there are different file size limits and file type restrictions. Document: 30 MB...
Read more >File size - Wikipedia
Typically, file size is expressed in units of measurement based on the byte. By convention, file size units use either a metric prefix...
Read more >Restrictions and limitations in OneDrive and SharePoint
Limitations · File upload and download sizes · File name and path lengths · Thumbnails and previews · Number of items that can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think you should be able to do it with the
fileFilter
property?Hi @LinusU
I have the same problem on Multer 1.4.2. I need to limit the file size on base of the file type for my project. It would be really nice, if that would be possible inside the file filter function.
Or can you expect when there will be a stable release for Multer 2.0?