Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Copy image into amazon S3

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 502
    Comment on it

    Here is the small steps to upload images or any file into amazon S3 server:-

      <?php 
        define('awsAccessKey', 'AKIAJMEIK5LU3NAR3BTQ');
        define('awsSecretKey', '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');
        function copyImagetoAmazon($imageFile) {
                    require_once('S3.php');
                    $bucket = 'acrmvideos/';
                    $s3 = new S3(awsAccessKey, awsSecretKey);
                    $fileName = 'test.png';
                    $fileTempName = $imageFile;
                    $s3->putBucket($bucket, S3::ACL_PUBLIC_READ);
                    if ($s3->putObjectFile($fileTempName, $bucket, $fileName, S3::ACL_PUBLIC_READ)) {
                            $message = "File uploaded successfully.";
                    }else{
                            $message = "File not uploaded. Please try again!!";
                    }
                    echo $message;
                }
    
            copyImagetoAmazon('a.png');
    
        ?>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: