Amiga.org
Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: Wilse on March 28, 2003, 09:17:09 AM
-
Can any of you tell this HTML begginer how to set a link which, when clicked, will download a .wav file?
Thanks in advance,
-
eh?
bapp
-
Moring geezers,
Whabangs code is perfectly ok for the job. However, it actually depends how your browser is set up - if your MIME settings recognise .wav, it may just play the wave in situ.
Still, you can always shift/right click the link (depending on browser) and opt to save the target, so not really a problem.
Download handlers for different files are often written in in scripting languages, such as javascript. Not much use if your new to the area though :-)
-
whabang wrote:
eh?
bapp
I'll try it tonight, cheers.
-
Whabangs code is perfectly ok for the job.
Well, I already have this code, minus the 'bapp' part and it does play from the location.
What's 'bapp', anyway?
-
The bapp part is what the link text should say :-)
click here to download a .wav file
Writing a download manager is pretty tedious work and really not motivated just for a wav file. Most computer-savvy people know that they should right-click. For those who don't, just add a simple descriptive text ("right click to download").
Here's a quick reference if you're completely new to HTML: HTML Quick Reference (http://www.ku.edu/~acs/docs/other/HTML_quick.shtml)
-
Wilse wrote:
Whabangs code is perfectly ok for the job.
Well, I already have this code, minus the 'bapp' part and it does play from the location.
What's 'bapp', anyway?
Damn, Wilse, think with your head (the hairy thing on the top :-P ) just LOOK at the code.
HTML is a simple END-&-START delimited language. In that case, the tag used is the "A" one, one of the most common, used to link the entity enclosed to a file or location or whatever. BTW be careful and make sure that it points to something that EXISTS. In this very case your "filename.wav" has to live in the same dir as your HTML page file, witch is quite not tidy.
See ? It has a that starts, and that closes it. Whatever is in within the opening en end tags are affected, that is by clicking on the element the user will execute the action.
The syntax is always the same, if you open a you close it with a
, simple as that.
Now go away :rtfm:
pX
PS : A last word about your very issue : If what you want when a visitor clicks on your link (a text, image, anything) is some fancy custom player, maybe you should look towards Flash (http://www.macromedia.com/flash/)
-
The bapp part is what the link text should say
D'Oh!
I haven't woken up yet! :-P
Writing a download manager is pretty tedious work and really not motivated just for a wav file. Most computer-savvy people know that they should right-click. For those who don't, just add a simple descriptive text ("right click to download").
That's what I'll do, cheers.
-
Wilse wrote:
Well, I already have this code, minus the 'bapp' part and it does play from the location.
What's 'bapp', anyway?
The anchor tag needs some text .. if you don't specify it, you either won't have anything to click on, or depending on the browser, you'll probably have a short line that represents the link.
So: THIS IS THE TEXT THAT APPEARS AS THE LINK ON THE PAGE
Please check out www.w3.org (http://www.w3.org/MarkUp/).. You can teach yourself HTML very nicely by reading the specs and trying it out by writing some small pages, saving them to your hd and then opening them with your browser. There's even a 10min tutorial!
And regarding the above url.. Please, don't ask for more directions, that url is already one link deep into the site. You should find everything you need under that page, just dig around and then enjoy the feeling you get from finding something out by yourself!
Hmm, well, one hint.. The current version of HTML is HTML 4.01 .. you should be able to find the link to the spec now.
Also, once you get more experience, whenever you find a page and wonder how they did it, just Read The Source, Luke!
Good luck in your quest, HTML isn't very hard to learn, just don't give up if you don't immediately find something you're looking for.. :-)
-
Take a look here for a nice listing of available elements in html 4: http://www.w3.org/TR/REC-html40/index/elements.html
You can click on the element name to get more information, as well as some examples :)
-
Be mindful of the environment the server the HTML will end up on. If the server is *nix-ey (like linux/Sun etc...) filenames are case sensitive so if you make a link
Click here
and the file you upload from WinBloat or Amiga is called MyFile.wav the link won't work. Same goes for links to other pages. Remember this when you start learning or your first projects will have lots of seemingly broken-for-no-reason links!
Also ".." means parent directory and "." means current, use forward slashes as delimiters, with no starting slash the ref references from where the HTML file is, so to reference a file in the directory above the referencing HTML you'd use
Click here
-
You never stopped searching... :-D :-D :-D
-
whabang wrote:
You never stopped searching... :-D :-D :-D
:lol:
BTW, thanks everyone. It's working now.