You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to download multiple zips from for-loop call
below code closes the browser tab when 1st zip download starts so that remaining loops cant work
i.e.
$RowImagesData = array() // in which multiple references are added.
$obj =& get_instance();
$obj->load->library('s3_stream');
$obj->load->library('aws_sdk');
$s3_dir= 'images/';
$bucketname= 'XYZ';
How to download multiple zips from for-loop call
below code closes the browser tab when 1st zip download starts so that remaining loops cant work
i.e.
$RowImagesData = array() // in which multiple references are added.
$obj =& get_instance();
$obj->load->library('s3_stream');
$obj->load->library('aws_sdk');
$s3_dir= 'images/';
$bucketname= 'XYZ';
foreach ($RowImagesData as $RIKey => $RIValue)
{
$OrderId = $RIValue['reference']
$path = $s3_dir. $OrderId;
$files = $obj->aws_sdk->listObjects(array('Bucket' => $bucketname, 'MaxKeys' => 1000, 'Prefix' => $path))->getPath('Contents');
if(count($files) > 0)
{
$obj->s3_stream->download($bucketname,$path,$orderid);
}
else
{
echo "<script type='text/javascript'>alert('Order - $orderid does not exist');</script>";
}
}
The text was updated successfully, but these errors were encountered: