-
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
-
Please research "mime types". If the user's browser is configured to handle a certain mime type a certain way, then that's what is going to happen. If you want them to always download a file, then give them instructions on how to do that (usually, by right-clicking the link). Or, give the file a different mime-type and/or extension, and inform the user how to rename the file after it's been downloaded.
Similar Threads
-
By mikester20 in forum ASP.NET
Replies: 0
Last Post: 10-30-2006, 06:25 PM
-
Replies: 0
Last Post: 10-21-2006, 11:51 AM
-
By sachinkataria in forum Java
Replies: 0
Last Post: 09-25-2006, 11:46 AM
-
By Don Edwards in forum .NET
Replies: 0
Last Post: 11-22-2002, 01:43 PM
-
Replies: 0
Last Post: 01-12-2001, 12:27 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|