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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:09:34+00:00 2026-06-15T12:09:34+00:00

I have a regular JSP/Servlet/Java web application that is used for uploading pictures from

  • 0

I have a regular JSP/Servlet/Java web application that is used for uploading pictures from a mobile device. I am using Apache Commons library for the upload. Application is hosted on WebSphere Application Server 7.0.

Everything is working fine and the user can upload several images totaling 8MB or more if he has a really good/strong signal/connection or on a good WiFi.

The problem arises when the user is at a location with poor 3G/4G signal/connection. He gets errors like “Illegal state exception” or some time-out error, and in some cases the mobile browser just stays on the submit page with the progress bar no longer moving.

Any suggestions on how to “gracefully” handle this? Like is there a way to intervene after a set amount of time and give the the user an option to submit the form without the file attachment (i.e. just submit the form text fields)? Any other suggestions are welcome too.

UPDATE: The setTimeout solution below worked for me. The other missing piece was that I have to issue a “browser stop” command to stop the original submission that’s in progress before I can issue a re-submit. Otherwise, my re-submit command will just be ignored by the browser.

  • 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-15T12:09:35+00:00Added an answer on June 15, 2026 at 12:09 pm

    The usecase here is simple – if the upload didn’t finish in N minutes, remove/clear the field using javascript and resend the form.

    You don’t need to control the upload in the basic implementation, just safely asume that if you set a timeout to resend, it won’t happen if the first attempt was successful and the page reloaded.

    jQuery pseudocode:

    setTimeout(function(){
      $imageFieldNode.remove();
      $form.trigger('submit');
    },30000);//after 30 seconds
    

    The more advanced way is to use a ready solution for controlled upload. They work like that:

    1. upload starts
    2. js prompts the server in intervals with a GET query to get the size of content that was already received.
    3. everytime it gets the info – it reports progress.

    You can do a lot with these libs.

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

Sidebar

Related Questions

I have found out that I could validate email input using regular expressions. However,
I am a newbie trying to create a sample web application using; MySQL Java
I have this Regular Expression that matches the following strings: <!-- 09-02-2009 ---> <!--
I am having difficulty executing a MS SQL Server stored procedure from Java/jsp. I
I am using Struts/JSP for a webapp. I have a page A where I
I have used space characters in html to give regular spaces in my text
I am using Entity framework 4.1 I have regular object, and I set his
I have a project which will be made up mostly of Java Servlets, JSP/Html
Once again I have hit the wall. How to replace escape characters using regular
I want to do inplace editing where I have regular text (coming from a

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.