Zugzwang152
Lifer
Are any special headers needed in storing MS Office documents in a blob datatype in mySQL?
My script works for non-Office docs (tested with PDF and plain-text), but not Word, Powerpoint, or Excel files. When downloading these types, I get a bunch of messed up characters in the beginning. yet the same script downloads PDF's and plain text files fine.
This is my download script:
$fid = $_GET['fid'];
$result = mysql_query("SELECT * from files WHERE fid =" . $fid, $db);
$file = mysql_result($result, 0, "file");
$fname = mysql_result($result, 0, "fname");
$fsize = mysql_result($result, 0, "fsize");
$ftype = mysql_result($result, 0, "ftype");
header("Content-type: $ftype");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$fname");
header("Content-Length: $fsize");
echo $file;
edit: just tested this with *.au and *wav audio, and they don't work either. grrr whats going on here...
My script works for non-Office docs (tested with PDF and plain-text), but not Word, Powerpoint, or Excel files. When downloading these types, I get a bunch of messed up characters in the beginning. yet the same script downloads PDF's and plain text files fine.
This is my download script:
$fid = $_GET['fid'];
$result = mysql_query("SELECT * from files WHERE fid =" . $fid, $db);
$file = mysql_result($result, 0, "file");
$fname = mysql_result($result, 0, "fname");
$fsize = mysql_result($result, 0, "fsize");
$ftype = mysql_result($result, 0, "ftype");
header("Content-type: $ftype");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$fname");
header("Content-Length: $fsize");
echo $file;
edit: just tested this with *.au and *wav audio, and they don't work either. grrr whats going on here...