Hey!
Yes, this can be done.
Things you need to research are:
1. 1 How to set up basic authentication on your webserver for access to an HTML
document (your servlet). If client passes, then your servlet will respond with the
requested document,
otherwise send back a no-can-do message.
2. 2 Your servlet would send back the spread sheet or word document back to the
requesting browser using output stream.
3. 3 The browser must be set up (content-type) to handle the response document.
Notes:
Item #1 can also be done wholly by your servlet instead of the web browser.
Item #2 see Jason Hunter's, et al, "Java Servlet Programming" for ViewFile servlet.
Sans adieu,
Danny Rubis
Peter Corrigan wrote:
> Hi,
>
> Is it possible to have a file on a web server, lets say a word document or a
>spreadsheet that can only be passed to certain users with the right critera using a
>servlet?
>
> Basically, I want to be able to check the users session, (I can do this). If it
>meets the correct criteria, they have permission to view the file. If not then they
>cannot view the file.
>
> Can servlets pass a whole file out to the client?....
> Any pointers as to how one can do this?
>
> All help & pointers appreciated,
> Peter
>
> --------------------------------------------------
>
> Rage with the Bulls...
> Get your FREE @ragingbull.com Email Address
> Visit http://www.ragingbull.com/
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html