-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal/file upload configurations #1587
Comments
@WoH any suggestion? |
Sorry, missed this so far. Btw, you can tag it as help wanted or pending feedback to avoid the bot. Is it enough to provide this once for the entire app? I am worried the next follow up would be multer config for down to per Endpoint level. |
I think the global options we provides in RegisterRouter parameter could cover all. |
Hi @jackey8616, As proposed in this pull request, you can provide your custom multer to |
it's already supported in RegisterRoutes(router, {
multer: multer({
limits: {
fieldNameSize: 120,
},
}),
}); |
@midoelhawy |
@WoH In the meantime, I will working on another PR enhance the @uploadedfile decorator with multer options in order to make specific restriction on each file and endpoint. |
Isn't routes.ts file auto-generated? Where should this logic be implemented? |
Hi @ashoktamang, You need to register the autogenerated route in your Express app server using the |
Currently in express/koa we have multer, hapi itself can handle file upload.
I've notice that we provides multerOptions in tsoa.json for preset a global multer instance.
But such option is not event fit for hapi users.
When the #1483 gives the idea of custom instance of multer,
I think its time to make something more 'general' for all users.
Here is my proposal:
RegisterRoutes
parameter, allow users to provide it in there server.ts.@UploadOptions
takes more options and merge with default global configuration to provides different uploading setup for each endpoint.The text was updated successfully, but these errors were encountered: