<?php
// The file name that you have uploaded earlier
// Change to your file name
$object_key = \'yourimage.png\';
// S3 Bucket Name
// Change to your bucket S3 bucket name
$bucket = \'wordpressha\';
// S3 Endpoint
// Change to your bucket S3 Endpoint URL
$s3_endpoint = \'ap-southeast-mys1.oss.ips1cloud.com\';
// S3 Access and Secret Key
// Change to your bucket S3 Access & Secret Key
$access_key = \'5IRK7V7TVSV0B829WHAD\';
$secret_key = \'I7BLtOZAsHdCDHMeyJ73QipBIPjLDCvWhIAzfynV\';
$expires = time() + 3600; // URL expiration time (1 hour from now)
$method = \'GET\'; // HTTP method
// Create the string to sign
$string_to_sign = "{$method}\\n\\n\\n{$expires}\\n/{$bucket}/{$object_key}";
// Create the signature
$signature = base64_encode(hash_hmac(\'sha1\', $string_to_sign, $secret_key, true));
// Generate the presigned URL
$presigned_url = "https://{$bucket}.{$s3_endpoint}/{$object_key}?AWSAccessKeyId={$access_key}&Expires={$expires}&Signature=" . urlencode($signature);
echo "Presigned URL: {$presigned_url}\\n";