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 file download-user authentication-window close Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "file download-user authentication-window close" Watch "file download-user authentication-window close" New topic
Author

file download-user authentication-window close

Ma Di
Greenhorn

Joined: Nov 28, 2000
Posts: 6
I'm involved a project to let staff to access valuable files
throught intranet. I want to realize the following functions:
1. When the user clicks the zipfile download image in a html page, a user authentication window appears to ask user to enter
userid&passwd. I write the required zipfile name as a hidden
field in the authentication page.
2. Next, after entering the userid&passwd, the user clcik the
"submit" button in the user authentication page. The download
servlet then check the validity of the userid&passwd. If it's
a valid user, the download servlet sends user the required file.
I use res.redirect(zipfile) to send user zipfile.
3. After the user receives the zip file, close the authentication
window which asks userid &passwd
My problem is I don't know how to and when to close the authentication. Because after the download servlet redirect the
zipfile to the user, it can't receive request from user browser
any longer.
Can you tell me how to refine and realize the download-authentication-window close process?
Thanks a lot in advance.
Rgds,
Ma Di
Anil Vupputuri
Ranch Hand

Joined: Oct 31, 2000
Posts: 527

Yeah, once u say response.redirect(zipfile) u cant access the request from browser unless u use other alternatives like
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(zipfile);
dispatcher.include(request, response);
(Used for including the content generated by another server resource in the body of a response)
[or]
dispatcher.forward(request, response);
(Used for forwarding a request from this servlet to another resource on the server.)

In both ways u can get request object back.
Anil.



SCJP 1.5, SCEA, ICED (287,484,486)
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: file download-user authentication-window close
 
Similar Threads
HttpSession and not allowing multiple users to log in from same browser
How to Download a File
open file-download window from servlet
Authentication Dialog Box
Close Popup Window after download completes