m4a corruption at download
I am hosting a private site so I can access a hard drive full of m4a files remotely. I can listen to these files directly off the usb hard drive no problem with linux apps or ms apps. These files are not protected. The site is apache running on slackware 10.2. The client-side computers are either Slackware 10.2 or windows XP—same problem for each. It is a secure/protected site for my listening pleasure. Everything seems to work perfectly. A php script reads the chosen file prompting a download/execute prompt in firefox. But when the m4a files are downloaded from the site they are corrupted. I ran md5sum (slackware md5) on the original and the downloaded m4a file to check for corruption; they are different. And each download of a particular m4a file is the same--ie. no variation in how a given file is corrupted. The downloaded files are also ~30 bits larger than the original of, say, 4.3 mb file. Each file is found and saved exactly as they are named with the m4a extension. Copying the m4a from the usb hard drive to a linux file causes no corruption. This is a high-speed connection.
Cause? Solution? Further tests?
What could the increase in filesize indicate? Evil headers? Any experience with this?
m4a files are evil and programmed to explode on download?
Am I missing something from the basic php script that would cause this (below)?
No media application that could play the originals can deal with the downloaded files.
Does not work with Firefox or IE or Konqueror.
$ctype=application/m4a;
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-Disposition: attachment; filename=\"".basename($filename)."\";" );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));
readfile("$filename");
exit();
PS: I want to make this work with my project. I don't want the solution to be "use ftp". This should not be happening.
-MarcusG
|