Hi,
I have problems with downloading .wav files, using php.
I just need to stream the .wav files. (filesize is normally 50 - 150 M😎.
I tried the following methods.
header("Content-type: ".$fType);
header("Content-Transfer-Encoding: binary");
header("Content-length:".filesize($srcTrack));
header("Content-Disposition: attachment;filename=".$fileName);
Method 1:
$fh = fopen($srcTrack, "r") or die("Could not open file!");
$data = fread($fh, filesize($srcTrack));
fclose($fh);
echo $data;
Method 2:
readfile($srcTrack);
Method 3:
$fp = fopen($srcTrack, "rb");
fpassthru($fp);
In all cases, Im able to stream the .wav file and force the download prompt.
The issue is, im not able to play the downloaded .wav file
Please help me, what im missing.
Thanks in advance, for any help.
Srini