
Signature
simon@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/
;; Sending your money to someone just because they've erected
;; a barrier of obscurity and secrets around the tools you
;; need to use your data does not help the economy or spur
;; innovation. - Waffle Iron Slashdot, June 16th, 2002
>> I am new to JSP and here stuck with a problem.....need help
>>
[quoted text clipped - 3 lines]
> Just link to the file, as you would in HTTP. There's nothing special or
> clever you need do.
This will only work if the file is in a directory which is being served
by the webserver. E.g. if you want to provide download to a file like
"C:\myFile.zip", you'll probably instead need to provide a link to a page
whose sole task is to read arbitrary files on the file system, and remit
their contents, e.g. <a
href="./downloader.jsp?link=C:\myFile.zip">Download</a>. But then you'd
probably want to implement some security so that people couldn't use that
page to download, for example, a list of username and passwords from your
server.
- Oliver
Krish - 09 Nov 2006 08:27 GMT
thanks for the solution......but what should I code in
downloader.jsp...
Thanks oncce again
> >> I am new to JSP and here stuck with a problem.....need help
> >>
[quoted text clipped - 15 lines]
>
> - Oliver
Oliver Wong - 10 Nov 2006 14:45 GMT
> thanks for the solution......but what should I code in
> downloader.jsp...
> Thanks oncce again
Sorry, I don't know. I'm more of a PHP guy than a JSP guy.
- Oliver
Andrew Thompson - 11 Nov 2006 02:06 GMT
> thanks for the solution......but what should I code in
> downloader.jsp...
Java, primarily.
As an aside - this is not a 'code generating machine'.
If you don't know what to put in the JSP (after
getting broad directions from those experienced in
server security), you either need ot learn Java or
hire a Java programmer.
Andrew T.
Simon Brooke - 09 Nov 2006 13:10 GMT
>>> I am new to JSP and here stuck with a problem.....need help
>>>
[quoted text clipped - 10 lines]
> whose sole task is to read arbitrary files on the file system, and remit
> their contents,
Do NOT - not ever - do that. Your webserver has a lot of security built in
precisely to prevent attackers being able to read arbitrary files in your
file system. If potential attackers /can/ read arbitrary files in your
file system, you just lost control of your server.
If you want people to be able to download a file, move that file into the
webserver's document root. Do NOT try to work around that.

Signature
simon@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/
;; this is not a .sig