How to create a instance of aws s3 class to upload files using php?

  • 0

if (!class_exists(‘S3’))
require_once ‘s3.php’; // include s3.php file
if (!defined(‘awsAccessKey’))
define(‘awsAccessKey’, ‘keyhere’); //awsAccessKey key here
if (!defined(‘awsSecretKey’))
define(‘awsSecretKey’, ‘secretkey here’); //secret key
$bucketName = “bucketname”; // bucketname
if (!extension_loaded(‘curl’) && !@dl(PHP_SHLIB_SUFFIX == ‘so’ ? ‘curl.so’ : ‘php_curl.dll’))
exit(“\nERROR: CURL extension not loaded\n\n”);
$s3 = new S3(awsAccessKey, awsSecretKey);

For more deatils : https://www.pgs-soft.com/blog/how-to-store-and-manage-files-on-amazon-s3-with-php-class/

if (!class_exists(‘S3’)) require_once ‘s3.php’; // include s3.php file if (!defined(‘awsAccessKey’)) define(‘awsAccessKey’, ‘keyhere’); //awsAccessKey key here if (!defined(‘awsSecretKey’)) define(‘awsSecretKey’, ‘secretkey here’); //secret key $bucketName = “bucketname”; // bucketname if (!extension_loaded(‘curl’) && !@dl(PHP_SHLIB_SUFFIX == ‘so’ ? ‘curl.so’ : ‘php_curl.dll’)) exit(“\nERROR: CURL extension not loaded\n\n”); $s3 = new S3(awsAccessKey, awsSecretKey); For more deatils : https://www.pgs-soft.com/blog/how-to-store-and-manage-files-on-amazon-s3-with-php-class/

if (!class_exists(‘S3’)) require_once ‘s3.php’; // include s3.php file if (!defined(‘awsAccessKey’)) define(‘awsAccessKey’, ‘keyhere’); //awsAccessKey key here if (!defined(‘awsSecretKey’)) define(‘awsSecretKey’, ‘secretkey here’); //secret key $bucketName = “bucketname”; // bucketname if (!extension_loaded(‘curl’) && !@dl(PHP_SHLIB_SUFFIX == ‘so’ ? ‘curl.so’ : ‘php_curl.dll’)) exit(“\nERROR: CURL extension not loaded\n\n”); $s3 = new S3(awsAccessKey, awsSecretKey); For more deatils : https://www.pgs-soft.com/blog/how-to-store-and-manage-files-on-amazon-s3-with-php-class/