Express fileupload for universal controllers
npm install @universal-packages/express-controllers-fileupload


Express fileupload middleware for universal controllers.
``shell
npm install @universal-packages/express-controllers-fileupload
npm install @universal-packages/express-controllers
`
#### setFileUploadOptions(options: fileUpload.Options)
Set up options for the fileupload middleware, so you don't have to repeat them in every action.
`js
import { setFileUploadOptions } from '@universal-packages/express-controllers-fileupload'
setFileUploadOptions({ useTempFiles: true })
`
#### @UseFileUpload([options: fileUpload.Options])
Set a particular action to use the file upload middleware.
`js
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
}
}
``
This library is developed in TypeScript and shipped fully typed.
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.
- Code of Conduct
- Contributing Guide