Skip to content
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

How to limit max upload size? #297

Open
ertugrulcetin opened this issue Jun 29, 2017 · 7 comments
Open

How to limit max upload size? #297

ertugrulcetin opened this issue Jun 29, 2017 · 7 comments

Comments

@ertugrulcetin
Copy link

Is there any way to limit max upload size? If so could you provide an example please?

@weavejester
Copy link
Member

You mean with the multipart middleware?

@ertugrulcetin
Copy link
Author

ertugrulcetin commented Jun 29, 2017

On jetty side, I have an endpoint which accepts octet-stream I want it to fail if it exceeds the limit.

@ertugrulcetin
Copy link
Author

Also yes, multipart middleware

@ertugrulcetin
Copy link
Author

@weavejester any suggestions?

@weavejester
Copy link
Member

You can create a custom multipart store that limits the files to a certain size. Take a look at ring.middleware.multipart-params.temp-file and ring.middleware.multipart-params.byte-array. You can adapt or wrap these multipart stores to limit the size of the items.

I don't currently have time to come up with an example for you, however.

@ertugrulcetin
Copy link
Author

ertugrulcetin commented Jun 30, 2017

@weavejester thank you so much I think I figured it out! Are you gonna add this functionality to ring any time soon? That would be useful though

@weavejester
Copy link
Member

When I get time, or someone sends me a PR, it would be useful functionality to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants