Upload File across Requests in Struts 1.1

The case is uploading file through struts(v1.1) into database through 2 submission steps. In the first step, user submit his request form with a file in it. Then on the second page, users confirm this request and submit final form, when the file should actually be stored into database. Our sever is AWS servers and session is maintained in database.

So the question is how to get this file and store it at the final submission?

Constraints:

  1. no putting file in session
    we’re now using session to temporary store this file, but it is not a good idea because the file size could be up to 50MB. we don’t want our session to be such a big one.

  2. no putting file in a temporary place on servers
    because requests can hit different managed servers during multi-steps form submission, and if a request hit one server different from where the file stored, the file would be lost.

  3. no AJAX solution to implement forms, due to customer specifications.

I wonder if I can keep the path to the file to upload and pass it to the second page, then read it and submit it at the final submission. But not sure if it is possible or how to implement this.


Source: jsp

Leave a Reply