ask - Download all from blob

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
monmon
Forum Newbie
Posts: 1
Joined: Tue Jan 25, 2011 10:25 pm

ask - Download all from blob

Post by monmon »

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

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.";
}

thx
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: ask - Download all from blob

Post by Jade »

Hmm. I'm not sure you can. The only thing that comes to mind is trying to zip all of the files into another zip...haha if that made any sense whatsoever.
Post Reply