ask - Download all from blob
Posted: Tue Jan 25, 2011 10:32 pm
please help,
i want to download zip file from blob not 1 by 1, but all
this is my working code download file 1 by 1
thx
i want to download zip file from blob not 1 by 1, but all
this is my working code download file 1 by 1
Code: Select all
$code=$_GET['fileId'];
include("config.php");
$query = "SELECT * FROM profile where code='$code'";
$result = mysql_query($query) or die("Couldn't get file list");
if(mysql_num_rows($result) == 1)
{
$fileContent = @mysql_result($result, 0, "content");
$code = @mysql_result($result, 0, "code");
header('Content-Disposition: attachment; filename="' . $code . '"');
header("Content-type: application/zip");
echo $fileContent;
}
else
{
echo "Record doesn't exist.";
}