Skip to content

How to limit the uploaded file size? #3528

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

Open
luhengyu1 opened this issue May 15, 2025 · 2 comments
Open

How to limit the uploaded file size? #3528

luhengyu1 opened this issue May 15, 2025 · 2 comments

Comments

@luhengyu1
Copy link

I want to deploy the service on my own server by Docker, and it worked.
But i want to limit the file size, for example : any request with a bigger than 10MB file will be rejected.

In springboot application yml like this
servlet:
multipart:
max-file-size: 10MB

I did read the related documentation, but i did't find it.
How should i do that? Or is there a default configuration? Thanks.

Copy link

dosubot bot commented May 15, 2025

Hello @luhengyu1! I'm Dosu, here to help you with bugs, questions, and anything else you might need while you wait for a human maintainer. Let's tackle your file size limitation issue together!

To limit the uploaded file size in Stirling-PDF when deploying via Docker, you can use the SYSTEM_MAXFILESIZE environment variable. Set this variable to your desired maximum file size in megabytes. For example, to limit the file size to 10MB, you would set SYSTEM_MAXFILESIZE to "10" in your Docker configuration [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@Ludy87
Copy link
Contributor

Ludy87 commented May 16, 2025

add:

    environment:
      SYSTEM_FILEUPLOADLIMIT: "10MB"

or see: How to add Configurations -> fileUploadLimit

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

No branches or pull requests

2 participants