최초 커밋

This commit is contained in:
root
2026-07-23 16:15:57 +09:00
commit c8f5efb6b7
14652 changed files with 4812531 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
require 'vendor/autoload.php';
use Aws\S3\S3Client;
use Aws\Credentials\Credentials;
$accountId = "81fa2d48964d31dd0da9558f9ce601d1";
$bucket = "baron-software-test";
$accessKey = "9ade5915f7abd402db60a87f3b3b6d76"; // write 권한
$secretKey = "a1a1cfd59f739977f98fb73f214894e39dbac9a39b1f6208020aa2e1303ea54c";
$credentials = new Credentials($accessKey, $secretKey);
$s3 = new S3Client([
'region' => 'auto',
'endpoint' => "https://{$accountId}.r2.cloudflarestorage.com",
'version' => 'latest',
'credentials' => $credentials,
]);
$filename = $_POST['filename'] ?? ('temp-' . time());
// presigned URL 발급
$cmd = $s3->getCommand('PutObject', [
'Bucket' => $bucket,
'Key' => "uploads/" . basename($filename)
]);
$request = $s3->createPresignedRequest($cmd, '+1 hour');
echo json_encode([
"url" => (string)$request->getUri(),
"filename" => $filename
]);