File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Download a file from java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic

Download a file from java

ramranga Kumar

Joined: Jul 21, 2006
Posts: 5
I gave the following in my jsp page

<a href="log.txt"> Click Here </a>

When I click the link "Click Here" the file log.txt is opened in the IE browser itself... But i want it to show the download dialog box with the open save buttons [which we can see while we download attachments in yahoo]

In java do we have something like response.setContent & response.write(
to download file.... If so please help me with your idea.

I also tried with Mozilla. But I got the same result as in IE.

Thank You
Waiting for reply.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
In Opera, a right-click instead of a left click gets me a list of options, including save-as.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.

Especially do not post in appropriate forums. This forum is for Advanced Java questions which your issue is most assuredly not.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Download a file from java
It's not a secret anymore!