'latest', 'region' => 'gh-greater-accra-dzen-ayor-home', 'endpoint' => 'http://192.168.68.152:9201', 'use_path_style_endpoint' => true, 'credentials' => [ 'key' => 'c7TpMCcy8txJftPu12Za', // MinIO Access Key 'secret' => 'NpbiqTjYkUDxUjliOP5fmXaTu6fOSWoKKJXnK1Ev', // MinIO Secret Key ], ]; $bucketName = 'permituploads'; $objectKey = 'uploads/Proposed L4L.docx'; // Path inside bucket try { $s3Client = new S3Client($minioConfig); // Create a pre-signed request valid for 1 hour $cmd = $s3Client->getCommand('GetObject', [ 'Bucket' => $bucketName, 'Key' => $objectKey ]); $request = $s3Client->createPresignedRequest($cmd, '+1 hour'); // Get the actual URL $presignedUrl = (string) $request->getUri(); echo "Pre-signed URL (valid for 1 hour):\n$presignedUrl\n"; } catch (AwsException $e) { echo "SDK Error: " . $e->getMessage(); } catch (Exception $e) { echo "Error: " . $e->getMessage(); }