...

View Full Version : downloadable wavs



skurry
11-27-2002, 11:10 PM
I know there's probably an easy explanation for this so I'll get right to the point lol..

When a person enters a certain part on my site there will be links saying something similar to this ;

kiis1.wav ; click to listen

how do I get the file to download to there computer when they click on the link?

..does that make sense? pleasee help

zoobie
11-27-2002, 11:20 PM
You want them to listen on your site or send them the file?

skurry
11-28-2002, 12:11 AM
I actually want it to download to their computer so it can be played in Windows Media Player, is it possible?

webmarkart
11-28-2002, 04:21 AM
just use a regular link:
<a href="sound.wav">click to listen</a>

It will probably promt them if they want to open or save the file, but either way its downloading to their computer. If the select open it will download to a temp directory and play in their default player and if they want to save it it will prompt them to select the directory to save it to.

zoobie
11-28-2002, 04:38 AM
I think you're going to have to do more research on this topic. First of all, wav's are huge. You can't ask someone to download a whole song...unless they have 30 minutes to spare. :D

skurry
11-28-2002, 05:47 AM
Um, it's not really wavs of a song at all. It's just clips of a person talking that are only like 15-20 seconds long..
Thank you for ya'lls help.

zoobie
11-29-2002, 08:18 PM
Did you get it?

brothercake
11-29-2002, 08:25 PM
You can use PHP to force a download. This as a file called "download.php":



<?

$saveName = stripslashes($HTTP_GET_VARS["name"]);
$savePath = stripslashes($HTTP_GET_VARS["path"]);

header ("Content-Type: application/octet-stream");
header ("Content-Disposition: attachment; filename=$saveName");
header ("Content-Transfer-Encoding: binary");
readfile($savePath);

?>



And then you call it with a link like this:



<a href="/download.php/?path=music/hifi/500mush.mp3&name=500mush.mp3">



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum