How do I go to Download dialog?

P

Paul Jones

Hi,

I have a download button on my website where the user can choose to
download an MP3 file. How do I take the user to the standard "Save As"
dialog in XP rather than to play the MP3 (which is all I've managed to
do thus far)? If possible, I'd rather avoid asking the user to
right-click over the button and choose "Save Target As".

P.S. I'm not using Coldfusion or Dreamweaver or any other authoring
utility (for reasons too complex to go into here) but I do have the
option of javascript or (as a last resort) a Java applet.

Thanks,
Paul
 
H

Harlan Messinger

Paul said:
Hi,

I have a download button on my website where the user can choose to
download an MP3 file. How do I take the user to the standard "Save As"
dialog in XP rather than to play the MP3 (which is all I've managed to
do thus far)? If possible, I'd rather avoid asking the user to
right-click over the button and choose "Save Target As".

If the user wants to listen to it now, why is it your business to tell
him to download it and listen to it later? Or vice versa?

What happens when the user clicks a link to a non-HTML resource depends
on how his browser is configured. You can't change that.
 
P

Paul Jones

Harlan said:
If the user wants to listen to it now, why is it your business to tell
him to download it and listen to it later? Or vice versa?

I'm giving the user the option of listening to the track(s) on a
separate button within the same html page. In fact, there are several
MP3s - it's all rather more complex than I said. What I don't want is
the user having to exit to a new page to listen to the song and then
having to reload the page (and lose lose his place) to listen
to/download other tracks.

So, is there no way to do what I want - not even with java/javascript?

Thanks,
Paul
 
E

Ed Mullen

Paul said:
I'm giving the user the option of listening to the track(s) on a
separate button within the same html page. In fact, there are several
MP3s - it's all rather more complex than I said. What I don't want is
the user having to exit to a new page to listen to the song and then
having to reload the page (and lose lose his place) to listen
to/download other tracks.

So, is there no way to do what I want - not even with java/javascript?

Thanks,
Paul

If you simply provide a link to the mp3 file, then the user's browser
configuration will dictate what happens when he left-clicks. It may
play the file using a browser plug-in with a small pop-up controller.
It may launch a separate application (in my case, Winamp) to play the
file. If there is no such functionality defined in the browser setup,
the user should get a pop-up asking what to do with the file. At that
point he could play it in a selected external app or download/save it.
Further, by providing a direct link to the file the user can right-click
and save the file for later playing in his favorite audio app.

You could use an embedded approach rather than a simple link. However,
that is fraught with issues that go back to the differing possible
system configurations of your users. Likewise, invoking a java player
applet can't be guaranteed to work for everyone. Some people don't have
java installed.

On my site I simply provide direct links to the mp3 files.

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
http://abington.edmullen.net
Sex: In America an obsession. In other parts of the world a fact. -
Marlene Dietrich
 
K

kdarling

Paul said:
I have a download button on my website where the user can choose to
download an MP3 file. How do I take the user to the standard "Save As"
dialog in XP rather than to play the MP3 (which is all I've managed to
do thus far)? If possible, I'd rather avoid asking the user to
right-click over the button and choose "Save Target As".

If you can change the HTTP settings on the server, set the Content-Type
in the reply header to be "application/octet-stream". Most browsers
will then give the user the chance of saving it.

Kev
 
L

Leif K-Brooks

If you can change the HTTP settings on the server, set the Content-Type
in the reply header to be "application/octet-stream". Most browsers
will then give the user the chance of saving it.

What do you think your tricky little scheme will do to a browser that
uses the Content-Type header to determine what type metadata (extension,
OSTYPE, UTI, on-disk MIME type, whatever) is stored with the file?
application/octet-stream should only be used when your data is really
nothing more specific than a stream of octets.
 
N

nagasaki mike

Paul Jones said:
Hi,

I have a download button on my website where the user can choose to
download an MP3 file. How do I take the user to the standard "Save As"
dialog in XP rather than to play the MP3 (which is all I've managed to
do thus far)? If possible, I'd rather avoid asking the user to
right-click over the button and choose "Save Target As".

P.S. I'm not using Coldfusion or Dreamweaver or any other authoring
utility (for reasons too complex to go into here) but I do have the
option of javascript or (as a last resort) a Java applet.
pardon my ignorance but what do you mean by a 'download button'? why not
just have a normal link to the mp3, they left-click it says open or save -
they choose save (or maybe open, who knows how they feel) job done. isnt it?
 
P

Paul Jones

nagasaki said:
pardon my ignorance but what do you mean by a 'download button'? why not
just have a normal link to the mp3, they left-click it says open or save -
they choose save (or maybe open, who knows how they feel) job done. isnt it?

Well, not really. What we have is a list of 15 tracks each with three
icons to the left. The first is a listen icon (depicted by a
semi-quaver) which plays the song in the same html page - I've now got
this working. The third is a lyrics icon (depicted by a page icon) -
this was never a problem. The second is a save icon (depicted by a
floppy disc icon). This seems nigh-on impossible to implement. As a
result, we've gone for bringing up an alert message when this icon is
clicked, which tells users words to the effect that they have to
right-click to save and will probably now be taken somewhere that we
can't predict and so they will have click the back button on their
browser to get back to what they were doing.

I think the one page solution is the ideal way of dealing with our
requirements and is easier for users to grasp (and keep their place). I
think it's a significant limitation of browsers that this cannot be
achieved without getting unacceptably dirty. I'm not alone here -
google searching shows that there are many people trying to do exactly
what I've been trying to do - all without success. It's amazing that
you can generate all sorts of browser events including a left-click and
a double click, but not a right-click.

Take care,
Paul
 
H

Harlan Messinger

Paul said:
Well, not really. What we have is a list of 15 tracks each with three
icons to the left. The first is a listen icon (depicted by a
semi-quaver) which plays the song in the same html page - I've now got
this working. The third is a lyrics icon (depicted by a page icon) -
this was never a problem. The second is a save icon (depicted by a
floppy disc icon). This seems nigh-on impossible to implement. As a
result, we've gone for bringing up an alert message when this icon is
clicked, which tells users words to the effect that they have to
right-click to save and will probably now be taken somewhere that we
can't predict and so they will have click the back button on their
browser to get back to what they were doing.

I think you're looking at this from the wrong perspective. From *your*
perspective, there's a perplexing number of possible ways the download
might work on the user's end. From the user's perspective, it works the
same way every time on his computer, and he already *knows* what that
is. Just let him do what he's already used to doing, whatever that is,
instead of trying to make it work *one* way, *your* way, which may not
be that the user is familiar with at all.
 
T

tcremer

As far as I know, there isn't a way to invoke the Save As dialog box
via JavaScript or by using other client side browser techniques. If you
really want to do this, it's easiest done server side via a script of
some sort.

But as mentioned previously, consider your end user... People have a
certain expectation of what will happen when left clicking on links,
regardless of what lives behind those links. Instead of trying to
reinvent the wheel so to speak, would it be possible to reinvent your
page and the MP3 links? A simple "Left click the file to open, Right
click the file to save" would make your life lots easier and your
visitor's as well.

-Travis
 
P

Paul Jones

Harlan said:
I think you're looking at this from the wrong perspective. From *your*
perspective, there's a perplexing number of possible ways the download
might work on the user's end. From the user's perspective, it works the
same way every time on his computer, and he already *knows* what that
is. Just let him do what he's already used to doing, whatever that is,
instead of trying to make it work *one* way, *your* way, which may not
be that the user is familiar with at all.

I disagree and so do the band. I wasn't asking how to design the app,
just how to invoke a simulated right-click. Furthermore, I don't
believe that the current, clunky, feel that you're describing is how
things will end up given time. Computer usage changes by the month.
ITunes doesn't work the way you describe for the very good reason is
that it's clunky. We're not going to agree here and, fortunately, you
have no input into the design.

Paul
 
P

Paul Jones

As far as I know, there isn't a way to invoke the Save As dialog box
via JavaScript or by using other client side browser techniques. If you
really want to do this, it's easiest done server side via a script of
some sort.

I accept this.
But as mentioned previously, consider your end user... People have a
certain expectation of what will happen when left clicking on links,
regardless of what lives behind those links. Instead of trying to
reinvent the wheel so to speak, would it be possible to reinvent your
page and the MP3 links? A simple "Left click the file to open, Right
click the file to save" would make your life lots easier and your
visitor's as well.

Just because this is the way everybody has to do this because of
browser limitations doesn't mean that it's the best way. Out of
interest, nobody in the band had any problem using the page the way
I've designed it. Two clicks, invoking previous knowledge, has to be
worse that one click that requires no knowledge of browser limitations.

Paul
 
P

password

Paul Jones said:
I accept this.


Just because this is the way everybody has to do this because of
browser limitations doesn't mean that it's the best way. Out of
interest, nobody in the band had any problem using the page the way
I've designed it. Two clicks, invoking previous knowledge, has to be
worse that one click that requires no knowledge of browser limitations.
and you are unaware of all the bother you are going through in order to get
this to happen?
the band and you may well have had no problem, maybe they have seen the
site, maybe you have explained things to them, but what about a stranger
just passing through? methinks you need some hci testing pronto.
 
K

kdarling

Paul said:
Just because this is the way everybody has to do this because of
browser limitations doesn't mean that it's the best way. Out of
interest, nobody in the band had any problem using the page the way
I've designed it. Two clicks, invoking previous knowledge, has to be
worse that one click that requires no knowledge of browser limitations.

I agree, simply because most people like my wife and father have no
clue about right-click to Save methods. The easier you can make it for
people like them, the better. The ones who already know how to
download are not a worry.

I agree with others, though, that clear instructions also make a world
of difference.

Cheers, Kev
 
L

Leif K-Brooks

Paul said:
We're not going to agree here and, fortunately, you have no input
into the design.

You post to Usenet, then _after_ getting useful replies, tell us that
you don't really care what we have to say?

Welcome to the killfile.
 
J

Joel Shepherd

Leif K-Brooks said:
You post to Usenet, then _after_ getting useful replies, tell us that
you don't really care what we have to say?

Usenet: You post, we discuss. The observant reader will note that the
original poster is under no obligation whatsoever to be grateful for or
even respectful of opinions or asserted facts during the discussion.

Kind of makes sense, given that others are under no obligation to
respond directly to the OP's inquiry. Why is that quid quo pro so
troublesome to you?
Welcome to the killfile.

Is it that extending a courtesy, or just a power thing? Why not just do
it without announcing it to the world?
 
P

Paul Jones

Joel said:
Usenet: You post, we discuss. The observant reader will note that the
original poster is under no obligation whatsoever to be grateful for or
even respectful of opinions or asserted facts during the discussion.

I am grateful for being told that it's impossible to go straight to the
download dialog. Thanks.

Paul
 
J

Jonathan N. Little

Paul said:
I am grateful for being told that it's impossible to go straight to the
download dialog. Thanks.

If I have my browser set to handle a certain media type in a
particularly way the last thing I want is a webpage changing that
default without my permission! Your situation is an MP3 but consider an
executable application/x-msdownload. I have it set (and you should too)
to download ONLY, could you see the potential problem if a webpage could
force a change in the default handling of that file type? That is why
the restriction and why there should be a clear distinction between
local and remote file systems regardless of what big Bill G. thinks...
 

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

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,086
Latest member
ChelseaAmi

Latest Threads

Top