HI
Download a wave file by using drupal ,Iam writing the code for downloading a wave file but it doesnot play
my code is like
function download()
{
$directory = /path1/path2/path3/path4/;
$filename ="msg0000.wav";
$wavefile="msg0000.wav";
$path = "$directory$filename";
if( file_exists($path) AND substr_count($filename,"/") == "0")
{
header("Content-type :audio/x-wav");
header("Content-Disposition: attachment; filename=$wavefile");
header("Content-Length: ".filesize($path));
readfile("$path");
echo "Download notification";
}
else
{
echo "Download error";
}
}
Iam writing this code in file that file is present in /home1/home2/home3/file.php
It download a file but there is no content so that the downloaded file cannot file .
This is my problem ,please help me.