|
Posted by Bone Ur on 11/18/07 07:40
Well bust mah britches and call me cheeky, on Sat, 17 Nov 2007 19:26:50
GMT J.O. Aho scribed:
>> This would be a server side script - like cgi?
>> or client side - like javascript?
>
> It has to be server side like php or any other scripting language.
>
> <?PHP
> $file="themp3file.mp3";
> header('Content-type: application/octet-stream');
> header('Content-Length: '. filesize($file));
> header("Content-Disposition: attachment; filename='{$file}'");
> readfile($file);
> ?>
The above code you posted was unfamiliar to me and looked interesting so I
tried it out using a .gif file instead of an .mp3, and voila!, it worked
except that I had to delete the single quotes from the Disposition line (-
and, following, deleted the then-superfluous curly braces) to avoid
receiving them in the open/save-to file name. Does this not happen to you
or am I missing something. Anyway, very clever.
--
Bone Ur (aka Neredbojias)
Cavemen have formidable pheromones.
Navigation:
[Reply to this message]
|