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 strongm 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
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 ?
 
thread215-225049 DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
There really isn't a way to have the browser run an .exe file because of security (and virus') threats...
You might be able to do this using activeX... I have not failed; I merely found 100,000 different ways of not succeding...
 
Maybe there is a shorter way of doing things, but you might also consider to compress the file (.zip). This is the way things are usually done when downloading shareware or freeware.
Hope this helps a bit.
Cheers,

xso
 
Hi -sounds like you haven't actually tried this yet, if you make a link to an .exe file your browser will prompt you with 2 choices

.Run this file from it's current location
.Download this file

or something like that...okeddy
 
Hi -sounds like you haven't actually tried this yet, if you make a link to an .exe file your browser will prompt you with 2 choices

Totally wrong!! That depends on what server you are running and whether the file is designed to be execcuted by the browser..

As I previously mentioned, some .exe files are designed to be executed by the browser on a windows system.

If you want me to set this up so that you can see it, no problem, just let me know..

You should think before you jump in with a comment like that.. [wink]

Hope this helps


Wullie

 
DeZiner, thanks for the link to the other discussion thread. It's very appropriate, but not very positive.

GUJUm0deL, telling me that a browser will not run an .EXE is a moot point, because that's exactly what happens on my test setup, and is what started my question in the first place!

XSO, Placing the file in a .ZIP archive does not guarantee a download either. My test system simply starts the program WinZip when the link is clicked.

Wullie, I have tried hosting the web site on IIS 5.5 (in Windows XP Pro), and Xitami web server, and my ISP's server (I do not know what software it is running). All three provided the same result.

OKeddy, the user prompting that you indicate depends heavily on the configuration of the user's system; What browser is running, configured settings, etc.




 
Have you cleared your cache recently? if you've clicked it, it should be there and windoze wil try running the cached version.

Ok i'll stfu now ;-) ***************************************
Party on, dudes!
[cannon]
 
Hi mate,

Sounds to me that there is a problem with your browser..

If you link to a zip file then you should be prompted to download..

When the download dialog appeared was the checkbox at the bottom checked or not? If it was checked, then whatever you decided to do at that time is remembered the next time you try to run it.. Seems like that is the problem..

What is the .exe file that you are trying to use?
Is it meant to be run from a browser?

Hope this helps Wullie

 
Wullie, I know that a fresh install of Windows will display the action prompts that you suggest, but I'm trying to find a solution that can be applied to the web page code, and will have the desired result, independant of the user's web browser, settings, or customizations, and also indipendant of the user's ability and knowledge or the "right-click" options.
 
Hi mate,

I meant in no way to imply that you should re-install windows, just that this is a browser setting.. Just reset your internet settings..

There is no code called when the .exe file is requested, the browser does not know how to open the file, so you are prompted to download it..

I am not sure why this bothers you so much as the user will have this everytime they request an exe file so what really is the problem here??

Hope this helps Wullie

 
Wullie... could you maybe point me in the right direction on executing an exe server side? Sounds interesting/useful.

gschafer@quickfreewebsite.com

Thanks, sorry for getting off topic everyone! -gerrygerry
Go To
 
Oh... ok, you mean run an exe as a cgi or something, right? I was hoping you had a magical way to run a script server side without necessarily changing the page location or loading popups or something... maybe some sort of an object insert... i dunno, i just didn't wanna question you!

I guess I'll just have to wait for some sort of .NET scripting that I understand LOL !

Thanks wullie! -gerrygerry
Go To
 
HardwareGuys, no need to get all defensive, sometimes pointing out the obvious can avoid answering the question at all... I have not failed; I merely found 100,000 different ways of not succeding...
 
Well Wullie you may be right but in most cases a link to an .exe file tells the browser to prompt you with choices(IE) or where do you want to save it(NETSCAPE).
Rather than write code which will be the same for every server and every browser you might as well zip it up (self extracting).
Maybe HardwareGuys you could give us the link and check the results with the crew here..okeddy
 
Hi guys,

Can I just clear up one point..

There is no need to zip the file unless,

1) You are trying to reduce bandwidth.
2) The file is designed to be executed by the browser.

When you try to download an exe file, the browser will prompt you, unless you have configured the browser to open the file from it's current location..

By all means zip the file, but if you have asked the browser to open files from their current location then there really is no point..

This is a browser setting that cannot be controlled unless you are sitting in front of the machine in question..

Hope this helps Wullie

 

"This is a browser setting that cannot be controlled unless you are sitting in front of the machine in question."


Damn, that's what I was affraid of, but was hoping someone had found a way to work around it with some kind of HTML or JavaScript code.

Thanks for all your input guys. I appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top