aspose file tools
The moose likes Servlets and the fly likes Downloading a File and Doing Something Else Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Downloading a File and Doing Something Else" Watch "Downloading a File and Doing Something Else" New topic
Author

Downloading a File and Doing Something Else

Dale Seng
Ranch Hand

Joined: Mar 22, 2004
Posts: 275
My servlet gets a request, and I respond by sending a file. That works okay, but after I get done pushing the file, I'd really like to go somewhere else. But I guess I'd need two requests... one to request the download, and another request to go somewhere else. So what's the 'right' way to do that? Would you do two submits somehow? It looks like this is OT now, but it started out in the servlet ;-) when I inserted the file download and realized my dispatch wasn't going to work any more :-(

--Dale--
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56521
    
  14

One technique I've seen is to send the page you want the viewer to see to the browser that uses Javascript to initiate the download in either another window or to a hidden iframe.
[ July 22, 2005: Message edited by: Bear Bibeault ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Downloading a File and Doing Something Else
 
Similar Threads
probelom while usuing content-disposition in response.setHeader()
How to access the request from an ActionServlet?
File download and request Forward
Checksum file download?
download file from tomcat server