How do I get a File Download dialog window to pop up?

G

Graham Stow

I have set up a 'downloads' directory on a website, but when I fire up the
browser and click on the files in it, they open within the browser itself.
How do I get the 'File Download - Do you want to open or save this file?'
dialog window to pop up, giving the user the choice of running the file or
saving it? I've fiddled around with the permissions of both the directory
and the files themselves, but can't find a setting that works - either the
user's permission is denied or the file opens in the browser.
 
J

J.O. Aho

Graham said:
I have set up a 'downloads' directory on a website, but when I fire up the
browser and click on the files in it, they open within the browser itself.
How do I get the 'File Download - Do you want to open or save this file?'
dialog window to pop up, giving the user the choice of running the file or
saving it? I've fiddled around with the permissions of both the directory
and the files themselves, but can't find a setting that works - either the
user's permission is denied or the file opens in the browser.

Some browsers are broken and need a false mime-type to download a file, so you
need to fiddle with the mime-types on the server, so it sends the "right" type
depending on what file you are serving.

If you are using a good webserver then go to alt.apache.configuration to get
some help, even if it's a bit off topic I'm sure they will help you.

If you are using a crappy one, then call up microsoft support for help.
 
M

Michael Fesser

..oO(J.O. Aho)
Some browsers are broken and need a false mime-type to download a file

Huh? Every browser allows to download files. It's just broken scripts
that try to "force" downloads where you have to use a false mime type
or the generic application/octet-stream.
, so you
need to fiddle with the mime-types on the server, so it sends the "right" type
depending on what file you are serving.

Files should be sent with the correct mime type, so it's left up to the
user/browser to decide what to do with them.

Micha
 
G

Graham Stow

This seems to be a browser problem. I was using IE 6.0 when I reported this
problem. In Opera v9.01 the dialog box opens every time. Anyone aware of a
fix for IE?
 
J

Jonathan N. Little

Graham said:
I have set up a 'downloads' directory on a website, but when I fire up the
browser and click on the files in it, they open within the browser itself.
How do I get the 'File Download - Do you want to open or save this file?'
dialog window to pop up, giving the user the choice of running the file or
saving it? I've fiddled around with the permissions of both the directory
and the files themselves, but can't find a setting that works - either the
user's permission is denied or the file opens in the browser.

Because your looking in the wrong place. Not a server setting, but a
browser setting. It is how *your* browser is set to handle targeted file
type. As a web designer, your really do not have control over how your
visitors' browsers are setup, so stop trying. For example if they use IE
and have it set to open Word documents in their browser rather than
download (unwise IMHO) so be it! Their choice.

Don't futz with your server's mime settings to falsely identify files of
the wrong type in attempts to *force* downloads that has been suggested.
 
R

Roy A.

Graham Stow skrev:
I have set up a 'downloads' directory on a website, but when I fire up the
browser and click on the files in it, they open within the browser itself.
How do I get the 'File Download - Do you want to open or save this file?'
dialog window to pop up, giving the user the choice of running the file or
saving it? I've fiddled around with the permissions of both the directory
and the files themselves, but can't find a setting that works - either the
user's permission is denied or the file opens in the browser.

The browsers let users decide how to handel files of diffrent types.
You shouln't change the MIME type just to force a download. What you
proberly should do is to serve the files in the downloads directory as
an attachment.

At the web server you couldt ad a Content-Disposition HTTP header for
the downloads directory with the value attachment. If you're not using
a graphical user interface, the syntax is "Content-Disposition:
attachment;".
 
J

Jonathan N. Little

Graham said:
This seems to be a browser problem. I was using IE 6.0 when I reported this
problem. In Opera v9.01 the dialog box opens every time. Anyone aware of a
fix for IE?
File

Okay, we'll try this again. The problem is *you* made a choice somewhere
along the line to open the file type in question (you have supplied
that bit of info) to open in the browser window instead of download and
your cleared the open to prompt to not ask again. So to fix this, do this.

For sake of demonstration, lets say that you have accidentally set IE to
open rather than download MS Word documents.

Open "My Computer" with Windows Explorer, yep remember IE is *really*
the file management tool Windows Explorer.

From the menu go to "Tools|Folder Options...|File Types"

Scroll and select "DOC Microsoft Word Document"

Click the "Advanced" button

Select options:
Confirm open after download
Always show extension (* I recommend this see rant below)

and clear option
Browse in same window

*
<rant>

You should *always* show file extensions on Windows machines! Especially
where Windows uses the extension decide how to handle a file (and where
it is an executable!) Never understood be Mr Bill felt that the last 3
letters after the period would be *way too confusing* for the public to
handle where that are so important to his OS and that an picture (icon)
would be better?! So he sets "Hide file extensions for known types"
enabled by default!

Where is the harm you say?

Okay take two files, "Readme.txt" "TrashYourSystem.exe". Now when your
make "TrashYourSystem.exe" give the executable the icon of a Notepad
document. Now rename "TrashYourSystem.exe" to "Readme.exe"!

Guess what "Readme.txt" and "Readme.exe" look like when "Hide file
extensions for known types" is enabled?

Windows security starts with good practices and I feel MS hasn't got a
clue at times!

</rant>


Whew...

Sorry just had to clear off another friend's infected computer recently...
 
R

Roy A.

Jonathan N. Little skrev:
Okay, we'll try this again. The problem is *you* made a choice somewhere
along the line to open the file type in question (you have supplied
that bit of info) to open in the browser window instead of download and
your cleared the open to prompt to not ask again.

Well, since the OP have suppied that bit of info I can't argue with
you. I whish only whish he could supply it to me too.
 
R

Roy A.

Jonathan N. Little skrev:
Okay, we'll try this again. The problem is *you* made a choice somewhere
along the line to open the file type in question (you have supplied
that bit of info) to open in the browser window instead of download and
your cleared the open to prompt to not ask again.

Well, since the OP have supplied that bit of info I can't argue with
you. I only whish he could supply it to me too.
 
J

Jonathan N. Little

Roy said:
Jonathan N. Little skrev:

Well, since the OP have suppied that bit of info I can't argue with
you. I whish only whish he could supply it to me too.
??? May comments were directed to OP (OP == "you") in my comments,
(Unless you == Graham Stow)

My error was I am missing a word, should have read "(you have *not*
supplied that bit of info)" with respect to what file type the OP has
opening in his browser instead of downloading.
 
G

Graham Stow

Okay, we'll try this again. The problem is *you* made a choice somewhere
along the line to open the file type in question (you have supplied that
bit of info) to open in the browser window instead of download and your
cleared the open to prompt to not ask again.
Very clearly explained, Jonathan. Apologies for being so dense.
Many thanks,
Graham
 
J

Jonathan N. Little

Jonathan N. Little wrote:
Argh! Either too few or too Many letters!
??? May comments were directed to OP (OP == "you") in my comments,

*My* comments were directed to OP (OP == "you") in my comments, ...
 
J

Jonathan N. Little

Graham said:
Very clearly explained, Jonathan. Apologies for being so dense.
Many thanks,

No problem. My main tirade was really directed to Mr. Gates. I have to
admit finding the setting for IE is not intuitive. You would think MS
would have added access to it while Explorer is in "Internet" mode since
the setting directly effects how files should be handled while
surfing... Personally I do not use the POS except for testing...and file
management.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top