Thread: File Download
View Single Post
  #1 (permalink)  
Old Nov 27th, 2006, 12:41
nileshnaik nileshnaik is offline
New Member
Join Date: Nov 2006
Location: Pune
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
File Download

Hi,
I need to download ".bat" file on click of an image.
The code is :
<script>
function downloadBatchFile() {
window.open('http://myserver/download.bat');
}
</script>
.....
<img src="FileDownload.gif" onclick="downloadBatchFile();"/>

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 <a href ..> 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);

Thanks,
Nilesh
Reply With Quote