Download the file from the s3 bucket using php. If the files are related to the database, Then there is no problem. Create a folder on the server where you will download the files.
<?php
$connection = mysqli_connect("localhost","DBUSER","DBPASS","DBNAME");
if(isset($_POST['d_pto']))
{
$foldername='DOWNLOAD_FOLDER';
$my_save_dir = $foldername.'/';
$sql="select url from your_table";
$query_result = mysqli_query($connection,$sql);
while($qdata2 = mysqli_fetch_array($query_result))
{
$adid=$qdata2['id'];
$main_photo=$qdata2['url'];
$url_to_image = "YOUR S3 BUCKET URL".'/'.$main_photo;
$filename = basename($url_to_image);
$complete_save_loc = $my_save_dir.$filename;
file_put_contents($complete_save_loc, file_get_contents($url_to_image));
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title></title>
</head>
<body>
<form name="form1" method="POST" enctype="multipart/form-data">
<input type="button" name="d_pto" value="Downloads Images" class="btn btn-success"/>
</form>
</body>
</html>
AWS S3 bucket policy for upload and download Goto AWS Account -> S3 -> Select Bucket&..
If you are unable to connect to port 22 on your Amazon EC2 instance, it could be due to several reas..
Solved Amazon ec2 not working when accessing through public IP Check your security group.. ..
EC2 means Elastic compute cloud.AWS provides secure and resizable compute capacity in cloud. ..
Aws Ec2 Single Instance Multiple domains. First, we go to the sites-available folder. Where there ar..
Get the latest news and updates by signing up to our daily newsletter.We won't sell your email or spam you !