It's not a secret anymore!
The moose likes HTML, CSS and JavaScript and the fly likes File Download Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "File Download" Watch "File Download" New topic

File Download

Nilesh Naik

Joined: Jul 18, 2006
Posts: 13
I need to download ".bat" file on click of an image.
The code is :

With this code, the file content are displayed in the new window. No download/save window is shown.
I tried doing the same with the help of tag. but the output is same.
Can any one help me on that.

(If I replace .bat file with .zip file it shows me the Save window, and the zip file can be downloaded);

John Davis
Ranch Hand

Joined: Aug 19, 2006
Posts: 73

this is the way I do it, I go to and load the file and then get the download link and say... well you know
hope this helps
Shyam kumar
Ranch Hand

Joined: May 21, 2006
Posts: 146
Try out this:

<a href="http://myserver/download.bat"><img src="FileDownload.gif"></a>
I agree. Here's the link:
subject: File Download
It's not a secret anymore!