seopher
asked on
RSS Enclosures in PHP
Trying to obtain the <enclosure> details for a podcasting page... I've got the content displaying properly but I need to access the content inside the enclosure.
Outputting the item gives:
[enclosure] => Array
(
[url] => http://website/directory/name.mp3
[length] => 4,374,069
[type] => audio/mp3
)
So I've got a "download this podcast" link but I can't get the [url] element from the enclosure... what is the syntax for doing this? Because it sure as butters isn't $item[url]
Offering 500 points because it's important!
Outputting the item gives:
[enclosure] => Array
(
[url] => http://website/directory/name.mp3
[length] => 4,374,069
[type] => audio/mp3
)
So I've got a "download this podcast" link but I can't get the [url] element from the enclosure... what is the syntax for doing this? Because it sure as butters isn't $item[url]
Offering 500 points because it's important!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ugh, thanks I was being rather dumb, that's done the trick perfectly.
Nice work.
Nice work.
function downloadfile($file,$ctype)
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: $ctype;");
header('Content-Dispositio
header("Content-Length: ".filesize($file).";");
readfile($file);
}