Sid | R2
05/16/2023, 7:13 PMGeorge Boot
05/16/2023, 8:26 PMWaldo
05/16/2023, 8:32 PMSiclude
05/16/2023, 8:50 PMhttps://cdn.discordapp.com/attachments/940663374377783388/1108134440175161364/image.png▾
Skye
05/16/2023, 8:52 PMFake User
05/17/2023, 5:44 AMjs
/* ---------- ⛅ UPLOAD TO CLOUDFLARE R2 ⛅ ---------- */
import{S3Client, PutObjectCommand} from "npm:@aws-sdk/client-s3";
import{load} from "https://deno.land/std/dotenv/mod.ts";
const env = await load();
//setup r2
const r2 = new S3Client({
region: env["R2_REGION"],
endpoint: env["R2_ENDPOINT"],
credentials: {
accessKeyId: env["R2_KEY"],
secretAccessKey: env["R2_SECRETKEY"]
}
});
//this object will upload
let objectWillUpload = {
Bucket: env["R2_BUCKET"],
Key: "this-will-upload",
Body: ""
};
r2.send(new PutObjectCommand(objectWillUpload));
//this object will not upload
let objectWillNotUpload = {
Bucket: env["R2_BUCKET"],
Key: "this-will-not-upload",
Body: "this really will not upload"
};
r2.send(new PutObjectCommand(objectWillNotUpload));
bret
05/17/2023, 12:29 PMHardAtWork
05/17/2023, 12:40 PMbret
05/17/2023, 12:41 PMdivby0
05/17/2023, 1:25 PMKarew
05/17/2023, 1:34 PMHardAtWork
05/17/2023, 1:35 PMdivby0
05/17/2023, 1:40 PMHardAtWork
05/17/2023, 1:50 PMSiclude
05/17/2023, 5:56 PMSid | R2
05/17/2023, 9:16 PMSid | R2
05/17/2023, 9:16 PMSid | R2
05/17/2023, 9:18 PMSiclude
05/17/2023, 9:24 PMFake User
05/17/2023, 9:31 PMFake User
05/17/2023, 9:32 PMhttps://cdn.discordapp.com/attachments/940663374377783388/1108507279751389246/run.png▾
Fake User
05/17/2023, 9:32 PMhttps://cdn.discordapp.com/attachments/940663374377783388/1108507357236969633/upload.png▾
Fake User
05/17/2023, 9:34 PMSid | R2
05/17/2023, 9:41 PMSid | R2
05/17/2023, 9:43 PMFake User
05/17/2023, 9:46 PMFake User
05/17/2023, 9:46 PMhttps://cdn.discordapp.com/attachments/940663374377783388/1108510861049471126/await.png▾
Fake User
05/17/2023, 9:46 PMhttps://cdn.discordapp.com/attachments/940663374377783388/1108510890510274560/sc.png▾
flayks
05/17/2023, 10:04 PMSid | R2
05/17/2023, 10:08 PM