Comments (2)
How about this option?
It might be easier to implement.
export interface BaseStorageOptions<T extends File> {
/** Allowed file types */
allowMIME?: string[] | { value: string[]; message?: string };
/** File size limit */
maxUploadSize?: number | string | { value: number | string; message?: string };
/** Filename generator function */
filename?: (file: T) => string;
...
usage:
const opts = {
allowMIME: {
value: ['image/png'],
message: 'Only PNG is supported.',
},
maxUploadSize: {
value: '50GB',
message: 'The file is way too big.',
},
},
};
from node-uploadx.
That should work as well. 👍🏻
from node-uploadx.
Related Issues (19)
- UnhandledPromiseRejectionWarning on HTTP Errors
- indirect dependency "node-forge" contain vulnerability HOT 2
- Action Required: Fix Renovate Configuration
- npm is crashing when trying to resume the upload HOT 3
- How to run functions and change response data HOT 8
- Limit chunk upload HOT 1
- Client for React HOT 2
- Dependency Dashboard
- How i handle a upload progress and resume events? HOT 3
- adapt upload for koa2?
- NODE-UPLOADX + .HTACCESS configuration. HOT 2
- Are checksum used to verify upload? HOT 3
- Metadata updates are not saved on disk
- Broken custom `onComplete` response
- S3 direct upload: custom cache/etag storage HOT 4
- @uploadx/s3 | how to change or add endpoint of digitalocean spaces HOT 6
- ensureFile fsMkdir exists error HOT 1
- [Help wanted] Module 'node-uploadx/lib/core' has no exported member 'Range' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-uploadx.