Is there a way of doing this? At the moment when I "link to file" then test, when I click the button it opens up in Quicktime within the browser.
Is there a way of doing this? At the moment when I "link to file" then test, when I click the button it opens up in Quicktime within the browser.
(Can't edit last post). Just discovered it's actually because of browsers that do this automatically, I need something called "forced download" and seem to require some kind of HTML command. Have been messing around with the Placeholder / HTML code but pretty clueless!
What about adding this simple direction to your link: "To download, right-click and select 'Save as'"
A couple of solutions :-
1. If you have an Apache server
Add AddType application/octet-stream .mpg to your .htaccess file.
2. If you are running PHP
Link using <a href="download.php?file=test.mp3">some.mp3</a> and use
Code:<?php $file = $_GET['file']; $dir = "path/to/files/"; if(!file) { die('file not found'); } else { $local_file = $dir . $file['filename']; $file = fopen($local_file, "r"); header("Cache-Control: public"); header('Content-Type: application/octet-stream'); header("Content-Description: File Transfer"); header("Content-Disposition: attachment; filename=$file"); header("Content-Transfer-Encoding: binary"); // set download rate $download_rate = 100.0; // fetch the file fread($file, round($download_rate * 1024)); // close the file stream fclose($file); } ?>
Tutorials: The Basics of Web Design - Tips and Tricks - Creating a Nav Bar - Video Tutorials - Stretchy Buttons - Manual Nav Bars
Thanks both. Boy: Good idea, I have done that on my sites and it would be a solution, it's just I don't want people to be able to read PDF's and play mp3's from my bandwidth I just want them to download it once.
Drwyd: One is on Apache so I could try htaccess for that as you suggest (I take it you mean mp3 not mpg for that?).
I've done a promotional offer giving away free stuff so bandwidth is starting to get a bit bottlenecked on the weekend. I have thought about having only 1 zip file for all 42 mp3 tracks (75MB), I was concerned some people might not be familiar with unzipping but recently it seems most systems like XP and Vista can unzip zip files already.
Bookmarks