Hi,

Perhaps this is a naive approach, but could you not simply put the file to
be saved behind a hyperlink?  If the file is an unrecognised format, the
user will be prompted to save the file to disk.  If the file is HTML, then
the user can at his/her option use the Browser 'file|save as...' command to
save the file to the browser's machine.

Regards,
Mark Foley

> -----Original Message-----
> From: Andy Bailey
> Sent: Thursday, July 29, 1999 3:53 AM
> To:   [EMAIL PROTECTED]
> Subject:      Re: File downloading in Servlets.
>
> > Hi,
> >
> > Iam using Servlets for our Server side programming. In one of our web
> pages
> > we've to allow the user to, save the data that he entered on the browser
> > into a file in his system(client machine). Can anyone suggest me the way
> for
> > coding in the Servlets.
> >
> > Thank you,
> > Ravi.
> >
> Hi Ravi,
>
> Browsers and servlets live on separate machines so there is no way a
> servlet
> can do what you
> want it to do. Signed applets could do this but this has its own problems.
> Much better to save
> the data on the server in such a way that a user can retrieve it easily.
> This is the only way
> if the data is of any significant length.
>
> There is a way that has been approved though. That is cookies. You can
> create and send cookies
> to the client browser which can store this data for you. This is only
> practical for small amounts of data though.
>
> Direct server to client harddrive access is a no no!
>
> There is a very good reason for this to happen, evil, nasty, stupid people
> sometimes try and stick
> malevolent software on client machines via the web and for this reason
> Browser security has been
> increased in order to prevent this very thing from happening.
>
> Hope this ramble helps
>
> Andy Bailey
>
> __________________________________________________________________________
> _
> 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

Reply via email to