Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie question: Downloads?

Status
Not open for further replies.

HardwareGuys

Technical User
Apr 15, 2002
18
0
0
CA
I have a simple HTML based web page. In it there is a simple link to an .EXE file. When a user visits the page and clicks on the link, the web browser may attempt to run the program instead of downloading the file.

How can I force the web browser (no matter what browser it may be) to actually download the file instead of trying to run it ?
 
This page ( ) has .EXE and .ZIP files available for download using either HTTP or FTP. Maybe you can find what you are lokking for by checking out the way that page works.
 
Hi mate,

Using FTP will not make a difference to the problem here.. The download dialog box is the same for both http and ftp.

Either way, no code is called so you have nothing to alter..

You also add a security risk if you allow anonymous ftp access, but that's a different story.. [wink]

Hope this helps Wullie

 
You should be able to accomplish this using ASP, ColdFusion, PHP, Perl, etc. to read the contents of the file into memory, then send the
Code:
content-type
header "application/octet-stream", with the
Code:
content-disposition
header set to "attachment", as I described more fully in thread215-257560
 
To get to the root of the problem, what you need to do is stop your web server from seeing .exe files as cgi programs to execute locally, and more as files that should be passed to the browser unevaluated (the way .html files usually are). If the web browser in question is IIS, I can tell you how to do it, but otherwise someone else might be able to. I know you said you have tried this on multiple configurations, but what is the target OS and Web Browser, and how much control over the server config do you have?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top