views:

26

answers:

1

Hi All,

I have seen lot of reviews and have not been able to figure out how I can solve my problem..

Problem:

Currently we have a page to upload the file from local machine to the respositry. It is currently using Struts upload. Now the current requirment is, Since users upload around 1gb of file, they are made to wait for a long time.. So they changed the requirment to browse the file and select the file to upload and hitting upload button should return to the control to next screen imediately.. But the upload process some how needs to be pushed at the backend and should do the upload and send out an email once the upload is complete..

I'm not able to figure out how to transfer the control to next page, when the upload is still running ... any idea or help will be appreicated..

Regards, Senny

A: 

You could try to upload the file using a trick that AJAX used to perform: the hidden iframe.

Theoretically (not tried it myself though) you could upload your file targeting an iframe, something similar to what is described in this article.

I had classic requests like this from clients who think that a browser can behave like any other desktop application would, which isn't the case in year 2010.

There are a lot of issues that can go wrong. Even if you upload the file behind the curtains, nothing keeps the user from moving away from the page afterward. He can load a new page, close the browser, close tabs etc and mess up the upload. You will get lots of corrupted files and you will be forced to introduce a lot of JavaScript code to try to limit the user's actions and you can't cover all basis.

This is clearly an usability issue. Have you considered using an upload progress bar instead? It gives the user something pretty to look at and also an estimate of the time that remains. You can find here an example for uploading with progress bar using Struts.

dpb