Forum Moderators: open

Message Too Old, No Replies

Downloading EXE from Form Trouble

Trying to make my form more accessible, but running into problems.

         

Jeremy_H

12:22 am on Dec 31, 2005 (gmt 0)

10+ Year Member



I'm trying to have an .exe file download when somebody clicks the "Download Now" button on my form.

It works now, but it requires JavaScript, and I'm trying to make all my sites more accessible.

The first version which is what I use now gives me the options "Run" "Save" and "Cancel". I really want the run option.

The second version only gives me "Save" and "Cancel".

What am I doing wrong?

Version 1:

<form>
<input type="button" onClick="parent.location='file.exe'" value="Download Now">
</form>

Version 2:

<form action="file.exe" method="get">
<input type="submit" value="Download Now">
</form>

Thanks so much for any help.

tedster

6:27 am on Jan 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is a standard browser function for users and I'm not sure why you want to bypass it - or even if it can be. I personally would hate to have an online .exe file run automatically.

All I can suggest is that if you know of a page that works the way you want, view the source and see how they do it.

Jeremy_H

9:16 am on Jan 1, 2006 (gmt 0)

10+ Year Member



Thanks for the reply.

I'm not trying to bypass any prompt. I'm just trying to make my site accessible, and for the users of my site, after having click on the "Download Now" button to be given to choice of "Run" "Save" or "Cancel".

I'm not looking to install anything without the user's permission or consent.

The thing is, I can get the "Run" option only when it's written in JavaScript.

I'm wondering if I need to setup something to send out a header, or change a file, I have not a clue.

Jeremy_H

9:33 pm on Jan 1, 2006 (gmt 0)

10+ Year Member



OK, I think I found part of the problem.

When it's using the <form action="file.exe" method="get"> method, it doesnt recognize the file type. It's unknown. Even if you save it, it doesnt recognize it's an exe file.

My guess is that if it recognized the file as an application, it would then solve my original problem.

So how can I get the browser to recognize it's an application file?

Thanks

encyclo

3:38 am on Jan 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is the server configured to recognize .exe files? If you are running Apache, you could try this in your .htaccess to see if it makes a difference:

AddType application/octet-stream .exe

Jeremy_H

7:45 am on Jan 2, 2006 (gmt 0)

10+ Year Member



Thanks encyclo,

That seemed like it should have worked, but didn't. I even tried different variations, like without the dot, or in capital letters.

I'm guessing I might have done something to upset the HTML god, or something.

Anyways, it hit me, I could just make it a standard text link to my file, and use CSS to make the text look like a button.

Thanks again everyone for your help!