Download objects to desktop

liunx

Guest
I am creating a personal web site and want to offer vistors the chance to Download <!--more--> some of the music I have written. Currently I have a simple anchor tag that points to a mp3 object containing the sample. When clicked, the music is Download <!--more-->ed and starts playing (using whichever music software is installed). However, I want the visitor to have the chance to save the file to disk, which is not happening.<br />
<br />
How do I get a Download <!--more--> dialogue window to appear, prompting the user to either save the file to disk or to open it directly?<br />
<br />
I would like this technique to also work with other objects such as Word documents or Excel spreadsheets - again, giving the user the chance to save to his hard disk rather than opening in the browser window...<!--content-->It depends upon the user-agent that the liveware has however, if you are using Apache Server you could use .htaccess and octet-stream to force Download <!--more-->s.<br />
<br />
For example within the .htaccess file you'ld write:<br />
<br />
AddType application/octet-stream .doc<br />
AddType application/octet-stream .xls<!--content-->Wow, thanks for the quick reply. The only thing is, I don't think I understand any of it! However, it seems like you are asking me to configure things I do not have any control over.<br />
<br />
The site is on freespace, so I do not have access to any of the server side configuration. I have a mp3 object sitting on the net in a directory and a simple anchor tag linking to it. I am trying force this link to Download <!--more--> and save the object, but from within my HTML or how the object is uploaded to the net, as I do not know how to configure any of the other things...<!--content-->do you have php?<!--content-->yes - and I have dabbled a little in this language...<!--content-->In that case here's one of pyro's examples: <!-- m --><a class="postlink" href="http://www.infinitypages.com/research/Download">http://www.infinitypages.com/research/Download</a><!-- m --> <!--more-->.htm<br />
<br />
ps - if you get stuck, ask pyro not me!!<!--content-->Wow, complicated but brilliant. Thanks a lot DaveSW for the tip to Pryo's code, and his solution backs up what Robert said in his post...will give it a go, but seems exactly what I was looking for....cheers all...<!--content-->just to explain the .htaccess a bit.<br />
<br />
Basically you create a file a txt file. Call it sumthing like a.htaccess (because windows tells you that you have to have a file name). In that file but the text<br />
<br />
AddType application/octet-stream .mp3<br />
<br />
<br />
then upload the file. When it's on the server rename it .htaccess make sure there is nothing before the '.'<br />
<br />
Just .htaccess.<br />
<br />
<br />
.htaccess is a settings file, as you have PHP it will probally work.<!--content-->
 
Back
Top