File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How does servlet respond during the file upload process ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How does servlet respond during the file upload process ?" Watch "How does servlet respond during the file upload process ?" New topic
Author

How does servlet respond during the file upload process ?

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2


Hi All,

I could not frame a reasonable text for the subject of this post, so had to use that subject, as partly the question is related to file uploading.

But the actual question is,

During the file uploads, specially if the file that is being uploaded is really huge, we do get notification something like "File is being processed" or some sort of progress bar, etc etc.

Now how is this particular functionality handled. Is this handled at client side or at server side?

If client side, how would client ever know, if the request is still being processed, as Servlet would not have committed the response back.

If Servlet sends those notifications back to client, that means it has already commited a response and the request/response cycle is over.


This above scenario is possible, if some sort of Asynchronous mechanism is employed, If I'm not wrong. But, is this actually possible in synchronous world? if yes, any pointers.

Thanks


Regards
KumarRaja

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

No, you don't get anything like that.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61232
    
  66

Submit the file upload to a hidden iframe. That way, the parent page is still active during the upload.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Bear Bibeault wrote:Submit the file upload to a hidden iframe. That way, the parent page is still active during the upload.


Hi Bear, would you mind elaborating a bit more on this. I have seen this functionality in one of our internal portals, where some files are uploaded. But the message "File being processed" is something displayed on a another small browser window, which is not the same browser the original request is sent. But again, how is this periodic notification happening in one single request/response cycle.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How does servlet respond during the file upload process ?