Menu
Hi, i had encountered problem with MP3 file links:
in IE/Safari/Chrome, when a link to a MP3 file is clicked, the download starts correctly; but in Firefox that doesn’t happen – clicking the MP3 file link, it starts an unwanted streaming through a preinstalled FF media plugin.
I need to [B]force MP3 file download
Not really in javascript, but if you set the files mimetype to [b]application/octet-stream[/b] you would normally receive the dialog(since that's a universal binary/cannot display in the browser but not saying what file type it is yet mime)[/QUOTE]
[CODE]<?php
$file = $_GET['file'];
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".$file.";");
header("Content-Length: ".filesize($file));
readfile($file);
exit;
?>[/CODE]
[CODE]<a href="direct_download.php?file=fineline.mp3">Download the mp3</a>[/CODE]
<%
Response.ContentType = "Application/octet-stream";
string FilePath = MapPath("song.mp3");
Response.WriteFile(FilePath)
Response.End()
%>
It's possible in asp.
[/QUOTE]
<%
Response.ContentType = "Application/octet-stream"
string FilePath = MapPath("song.mp3")
Response.WriteFile(FilePath)
Response.End()
%>
I've just had another thought, can't you just modify the iis settings?
http://technet.microsoft.com/en-us/library/bb742440.aspx [/QUOTE]
the PHP part is just one simple file and can handle multiple files... [/QUOTE]
Another option is to use a small PHP file to handle the download, put in the same folder as the .mp3:
[CODE]<?php
$file = $_GET['file'];
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".$file.";");
header("Content-Length: ".filesize($file));
readfile($file);
exit;
?>[/CODE]
which can be accessed in any anchor like this:
[CODE]<a href="direct_download.php?file=fineline.mp3">Download the mp3</a>[/CODE]
see sample page here:
http://www.cidigitalmedia.com/tutorials/direct_download/direct_download.html
Best of luck,
Eye for Video
www.cidigitalmedia.com [/QUOTE]
[CODE]<a href="direct_download.php?file=fineline.mp3">Download the mp3</a>[/CODE]
Are you saying that the download links I posted do not work in Safari?
The links all work just fine in Safari on my machine.
Or are you having problems when you implement that download php file?
[/QUOTE]
I'm using HTML/VBscript/Javascript (not PHP) in my webpages, but i thought to open a Multimedia Thread because the problem is an unwanted streaming process.
:o
So, how is it possible to change a MIME attribute of an MP3 file?... The need is to leave the file with his original extension because the same file is managed by a web-mediaplayer, but i'd like to let a download by clicking a specified button.[/QUOTE]
when add .mp3 file download but not actual[/QUOTE]
Another option is to use a small PHP file to handle the download, put in the same folder as the .mp3:
[CODE]<?php
$file = $_GET['file'];
echo"$file";
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".$file.";");
header("Content-Length: ".filesize($file));
readfile($file);
exit;
?>[/CODE]
which can be accessed in any anchor like this:
[CODE]<a href="direct_download.php?file=fineline.mp3">Download the mp3</a>[/CODE]
see sample page here:
http://www.cidigitalmedia.com/tutorials/direct_download/direct_download.html
Best of luck,
Eye for Video
www.cidigitalmedia.com [/QUOTE]
¥õú·Ûõ?9ÌîÇ4dmæ[Uµ¾ßókÜô€Ñ h®±Ó:w@ÿ9½9õ°UF«yCòÐÆ_¯øGæ9–-®‰}¹¦äK*»‹,qÔ—:¶9äÿiyÇøÅúÒ>²u_ª} ã"§ÞÁuì2Ë-'eUÖæû]E½KlÿIÿ½:ŠÛ‰V-.>ž;S>h
eÔ5.p×C÷îTnw‘ÿ4ÿr½nnPâ÷šÁë?]qz>Cq³³r{뵕·pØé÷ûu6Ei,®pð?æ»û•+œßþk¿ò*•ŸãC˜¦ìûhù$'ÿŒn¦æ¹ÔQÔ’]´wÔïjˆÆdÜöùÿšïüŠ£sëñ?æ»ÿ"·*ë½m„Ô-øû|'÷[>±ýau‡ÉŸúM0ÒÒò¹îqu'z–¸ì2744ï
Please, do not create a public file proxy on your server, as suggested by "Eye for Video" and "scragar", this is a MEGA HUGE security hole :eek:, an EXTREMELY DANGEROUS feature :eek:! Anyone could use it to download anything from the server, including password files, personal cookies, credit card information, stealing identity and even locally crack all username / passwords to remotely access your server and use it for whatever they want... NEVER CREATE A PUBLIC FILE PROXY :mad:!!! Geez...[/QUOTE]
I worry about people using iTunes and such, will messing with the Content-Type mess up other things? [/QUOTE]
Hi, i had encountered problem with MP3 file links:
in IE/Safari/Chrome, when a link to a MP3 file is clicked, the download starts correctly; but in Firefox that doesn't happen - clicking the MP3 file link, it starts an unwanted streaming through a preinstalled FF media plugin.
I need to [B]force MP3 file download[/B] in all browsers, is there a simple way to do that in Javascript?[/QUOTE]
Another option is to use a small PHP file to handle the download, put in the same folder as the .mp3:
[CODE]<?php
$file = $_GET['file'];
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".$file.";");
header("Content-Length: ".filesize($file));
readfile($file);
exit;
?>[/CODE]
which can be accessed in any anchor like this:
[CODE]<a href="direct_download.php?file=fineline.mp3">Download the mp3</a>[/CODE]
see sample page here:
http://www.cidigitalmedia.com/tutorials/direct_download/direct_download.html
Best of luck,
Eye for Video
www.cidigitalmedia.com [/QUOTE]
[code=php]
<?php
$file = $_GET['file'];
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".$file.";");
header("Content-Length: ".filesize($file));
readfile($file);
exit;
?>
[/code]
0.1.9 — BETA 5.5