Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9050849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:45:21+00:00 2026-06-16T12:45:21+00:00

I have a webapp on a Tomcat server that allows files to be uploaded.

  • 0

I have a webapp on a Tomcat server that allows files to be uploaded. There is a limit on the size of a file upload, and I’d like that limit to be enforced preemptively (ie, once you cross the limit, the file upload fails, rather than transferring the whole file, checking that it’s too big and then sending an error).

I tried to do this by add maxPostSize="1000" to the connector section in the relevant connector in server.xml, but I can still upload larger files.

I’ve seen a post indicating that maxPostSize only works for a specific content type.

So my question is whether what I’m doing is supposed to work. Is my limit not having an effect because I’ve configured Tommcat wrong, or because that field just isn’t applied to the kind of post that I’m doing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T12:45:22+00:00Added an answer on June 16, 2026 at 12:45 pm

    There is a very informative discussion of this topic here.

    As I understand it, Tomcat only enforces that limit if the content type is application/x-www-form-urlencoded. For multiparts you’ll have to read the stream yourself and enforce the limit yourself. A great tool for working with multipart data is Apache FileUpload.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tomcat server running a webapp. Apart from this there are two
I have a webapp that is deployed as a WAR file to a Tomcat
I have an Apache Tomcat server running. If I have something like: webapp/ image1.png
Assume that I have a webapp running on a Tomcat 6 server with the
I have a crazy request about restarting tomcat server through my webapp. I was
multiple webapp running on same tomcat using same jvm. sometime, one webapp that have
I have a Java webapp running on Tomcat. At runtime, I create images files
I have a servlet based webapp running on Tomcat 6 server. The URL scheme
I have a tomcat server with two webapps (foo and bar) that have an
I have a webapp (springmvc 3.0.5/java 1.6 based) that I'm deploying to a tomcat

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.