Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How do I get a File Download dialog window to pop up?

Reply
Thread Tools

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

 
 
Graham Stow
Guest
Posts: n/a
 
      01-13-2007
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.


 
Reply With Quote
 
 
 
 
J.O. Aho
Guest
Posts: n/a
 
      01-13-2007
Graham Stow wrote:
> 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.

--

//Aho
 
Reply With Quote
 
 
 
 
Michael Fesser
Guest
Posts: n/a
 
      01-13-2007
..oO(J.O. Aho)

>Graham Stow wrote:
>> 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


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
 
Reply With Quote
 
Graham Stow
Guest
Posts: n/a
 
      01-13-2007
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?


 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      01-13-2007
Graham Stow wrote:
> 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.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Roy A.
Guest
Posts: n/a
 
      01-13-2007

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;".

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      01-13-2007
Graham Stow wrote:
> 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...



--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Roy A.
Guest
Posts: n/a
 
      01-13-2007

Jonathan N. Little skrev:
> Graham Stow wrote:
> > 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.


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.

 
Reply With Quote
 
Roy A.
Guest
Posts: n/a
 
      01-13-2007

Jonathan N. Little skrev:
> Graham Stow wrote:
> > 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.


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.

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      01-13-2007
Roy A. wrote:
> Jonathan N. Little skrev:
>> Graham Stow wrote:
>>> 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.

>
> 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.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
beginner: how to close a pop up window before opening an other pop up Madame Blablavatsky Javascript 8 09-16-2005 10:27 PM
Create Yes/No dialog box; Getting JS values from pop-up window on submit gimme_this_gimme_that@yahoo.com Javascript 3 08-17-2005 12:42 AM
problem with code download file - two window file download Sam -- ASP .Net 2 03-17-2005 04:20 PM
Strange characters displayed in file name - File Download Dialog - IE Daniel Cardoso ASP .Net 1 09-24-2004 05:19 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57