@universal-packages/express-controllers-fileupload
v1.1.6
Published
Express fileupload for universal controllers
Downloads
709
Readme
Express controllers fileupload
Express fileupload middleware for universal controllers.
Install
npm install @universal-packages/express-controllers-fileupload
npm install @universal-packages/express-controllers
Global methods
setFileUploadOptions(options: fileUpload.Options)
Set up options for the fileupload middleware, so you don't have to repeat them in every action.
import { setFileUploadOptions } from '@universal-packages/express-controllers-fileupload'
setFileUploadOptions({ useTempFiles: true })
Hooks
@UseFileUpload([options: fileUpload.Options])
Set a particular action to use the file upload middleware.
import { BaseController, Controller, Post } from '@universal-packages/express-controllers'
import { UseFileUpload } from '@universal-packages/express-controllers-fileupload'
@Controller('good')
export default class GoodController extends BaseController {
@UseFileUpload()
@Post()
async action() {
this.request.files
}
}
Typescript
This library is developed in TypeScript and shipped fully typed.
Contributing
The development of this library happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving this library.