Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jginsburgn/formidable-middleware
A formidable proxy mountable as middleware.
https://github.com/jginsburgn/formidable-middleware
expressjs formidable middleware multipart-uploads npm-package
Last synced: 5 days ago
JSON representation
A formidable proxy mountable as middleware.
- Host: GitHub
- URL: https://github.com/jginsburgn/formidable-middleware
- Owner: jginsburgn
- License: mit
- Created: 2018-12-25T03:57:35.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-10T21:07:41.000Z (about 3 years ago)
- Last Synced: 2024-10-11T06:43:06.055Z (28 days ago)
- Topics: expressjs, formidable, middleware, multipart-uploads, npm-package
- Language: TypeScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A formidable Proxy Mountable as a Middleware
A proxy for [formidable][original-formidable] that acts as an Express middleware.
Use as follows:
```typescript
import express, {
Express,
Response,
} from "express";
import {
FormidableMiddleware,
FormidableMiddlewareRequest,
} from "@jginsburgn/formidable-middleware";const app: Express = express();
const formidableFormConfiguration = {
maxFileSize: 10 * 1024 ** 3 // 10 GB
};app.post("/", FormidableMiddleware(formidableFormConfiguration), (req: FormidableMiddlewareRequest, res: Response) => {
for (const file of req.body.files) {
// Do what you wish with the file...
}
for (const field of req.body.fields) {
// Do what you wish with the field...
}
});app.listen(80, "0.0.0.0");
```[original-formidable]: https://github.com/felixge/node-formidable