During FileUpload Session Expires

N

Nick

Hi,

I have a web application which use struts. I have used commons file
upload to allow the user to upload files using my web site.

The problem is when he uploads a file of large size say 20 MB the file
is uploaded successfully but the session expires.

Now I do not want to touch the session timeouts configured for the
application but during the file uploads I want the session not to
timeout or expire.

How can I do it in my Action Servlet ?

Any ideas ?

Thanks
Nick
 
A

Andrea Desole

Nick said:
Hi,

I have a web application which use struts. I have used commons file
upload to allow the user to upload files using my web site.

The problem is when he uploads a file of large size say 20 MB the file
is uploaded successfully but the session expires.

Now I do not want to touch the session timeouts configured for the
application but during the file uploads I want the session not to
timeout or expire.

it's not clear what you mean when you say you don't want to touch the
timeouts configured the for the application. Do you mean you don't want
to change the configuration? Or you don't want to change it
programmatically either? A solution might be to call
setInactiveInterval(-1) before you start the upload, and then call
setInactiveInterval again to reset the timeout to the configured value.
Another option is to make a copy of all your session information, upload
the file, and then check if a new session has been created. If it is,
you put back your copied session information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top