Hi All,
I've written a script that will output binary data that is stored in the database.
I've used the script on 2 different servers. It works fine one one, but when I use it on the other server, it doesn't work.
I'm uploading binary files (.doc, .xls, .jpg. etc...)
When I click on the link the calls the script that will "retreive" the files, I get an error.
On the server that it works, the link will prompt me to save the "file.doc".
On the OTHER server, it will prompt me to save but it says "www.site.com/file.php?fileID=5" basically the link refernce, and NOT the actual file name reference.
Can you see what's up??
** The script that I use to store the data, splits the data in chunks to alleviate any stress of downloading a 10 MB file from ONE record in the database (I read somewhere that was the best solution) Again, this script works on ONE server, but not the other...
Here's teh script that outputs...
header("Content-Type: $fileDataType");
header("Content-Length: $fileSize");
header("Content-Disposition: attachment; filename=$filename");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: public");
$q = "SELECT * FROM SS_RoleFileData WHERE ssRoleID='$ssRoleID' ORDER BY ssRoleFileDataID";
$r = mysql_query($q);
while ($ra = mysql_fetch_array($r)) {
echo $ra[fileData];
}