我需要为我的用户提供下载所有在我的项目中显示的图片的机会。图像显示从这样的一个MySQL查询:从mysql结果下载图片
$query = mysql_query("SELECT tl.customername, tl.visitdate, tl.employeename, pz.webpath from table tl
inner join pictures pz on pz.visitid = tl.visitid and pz.groupid = tl.groupid
inner join agenti ag on ag.idh = tl.employeeid
WHERE tl.visitdate >= '$from' AND tl.visitdate <= '$to'
AND tl.employeename like '$r_employee'
AND tl.customerowner like '$r_customer'
AND tl.customername like '$r_customername'
AND tl.visitdate like '$r_date'
group by pz.webpath order by tl.customername") or die(mysql_error());
while($associate = mysql_fetch_assoc($query)) {
echo '<li> <figure>
<img src="../core/includes/timthumb.php?src='.$associate['webpath'].'&w=200&h=200" />
<figcaption>
<h3>'.$associate['customername'].'</h3>
<h6>'.$associate['employeename'].'</h6>
<h6>'.$associate['visitdate'].' </h6>
';
echo '<a class="fancybox" rel="gallery" href="'.$associate['webpath'].'" title=" '.$associate['visitdate'].'/'.$associate['customername'].'">Big picture</i></a>';
echo '</figcaption>
</figure>
</li>';
$zip->addFromString(pathinfo (urldecode($associate['webpath']), PATHINFO_BASENAME), urldecode($associate['webpath']));
}
我该如何添加一个下载按钮,将所有的图像保存为zip在用户计算机上?
什么的结果呢?实际的图像数据或只是一个网址? 取决于你有多少用户/图像/服务器可能是一个比你期望的更大的问题。如果你给我更详细的信息,我可以给你一个合适的解决方案 –
用拇指(timthumb) - >点击 - >大图(fancybox)返回一个网格中的网址。我需要下载所有在网格中以全分辨率显示的图片。 – rozatrra
这是完美的,并且都在同一台服务器上的图片?或者你是否也必须从其他地方取他们? –