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 6571349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:52:15+00:00 2026-05-25T14:52:15+00:00

This is a very specific question. I hope there’s someone here with good knowledge

  • 0

This is a very specific question. I hope there’s someone here with good knowledge in FileUpload API.

If you have been worked with this API you should know that when the max size of a file has been exceeded the next items cannot be read because the FileSizeLimitExceededException is thrown and if you attempt to call one more time to hasNext() method to iterate to the next item an IOException is thrown because an inputstream is closed and you attempt to read it again.

This scenario is very bad because the next parameters cannot be read. Supose this form:

<form action="..." method="post" enctype="multipart/form-data">
    <input type="hidden" name="param1" value="foo"/>
    <input type="file" name="myFile"/><br/>
    <input type="hidden" name="param2" value="bar"/>
    <input type="submit"/>
</form>

Now the file exceeds the maximum size. Result:
“param1” is read.
“myFile” generates FileSizeLimitExceededException.
“param2” is not read.

I’m trying to rewrite part of the API -with no luck- because I want to read the next items (“param2” in this case).

Anyone has had the same problem? How have you fixed it?

Thanks.


EDIT: Well, I’ve implemented the solution proposed by BalusC. For the future:
FileUpload wrapper
FileUpload wrapper usage

If you consider that this wrapper needs anything else just say it. I don’t accept it as a real solution because the ideal is to modify and fix the API itself.

  • 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-05-25T14:52:16+00:00Added an answer on May 25, 2026 at 2:52 pm

    A way without hacking the API would be so set the upload file size limit to “unlimited” and examine the upload file size yourself afterwards by FileItem#getSize(). This may only take longer before the enduser get feedback about that, because the entire file needs to be read fully first (but you need to do it anyway in order to get all subsequent items).

    As a completely different alternative, you may want to look at the new HTML5 File API which offers you a way to examine the file size using JavaScript before the request is actually been sent.

    var size = document.getElementById("fileFieldId").files[0].size;
    // ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a very narrow and specific question, but I know there are someone
Very specific question but we have some good Ada people here so I would
this is a very specific question, but i also have very specific details on
This is a very specific question, however; Say I have a batch file running
Here's a very specific coding question: I've recently been asked to maintain some old-ish
I inspired by MeBigFatGuy interesting question , in this conection I have very specific
This is a very specific question regarding MySQL as implemented in WordPress . I'm
This is a very specific question which will probably earn me the tumbleweed badge,
This is a very specific question for a Google Chrome extension. http://www.meebo.com/mobile/ This page
I apologise in advance if this question isn't very specific. Would it be possible

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.