Update aws-compatible put signatures
This commit is contained in:
parent
fb452f2473
commit
ed0d485dfe
@ -32,14 +32,14 @@ export const isUrlFromAwsS3 = (url?: string) =>
|
||||
export const awsS3PutObjectCommandForKey = (Key: string) =>
|
||||
new PutObjectCommand({ Bucket: AWS_S3_BUCKET, Key, ACL: 'public-read' });
|
||||
|
||||
export const awsS3Put = (
|
||||
export const awsS3Put = async (
|
||||
file: Blob,
|
||||
fileName: string,
|
||||
): Promise<string> =>
|
||||
awsS3Client().send(new PutObjectCommand({
|
||||
Bucket: AWS_S3_BUCKET,
|
||||
Key: fileName,
|
||||
Body: new File([file], fileName),
|
||||
Body: Buffer.from(await file.arrayBuffer()),
|
||||
ACL: 'public-read',
|
||||
}))
|
||||
.then(() => urlForKey(fileName));
|
||||
|
||||
@ -53,14 +53,14 @@ export const isUrlFromCloudflareR2 = (url?: string) => (
|
||||
export const cloudflareR2PutObjectCommandForKey = (Key: string) =>
|
||||
new PutObjectCommand({ Bucket: CLOUDFLARE_R2_BUCKET, Key });
|
||||
|
||||
export const cloudflareR2Put = (
|
||||
export const cloudflareR2Put = async (
|
||||
file: Blob,
|
||||
fileName: string,
|
||||
): Promise<string> =>
|
||||
cloudflareR2Client().send(new PutObjectCommand({
|
||||
Bucket: CLOUDFLARE_R2_BUCKET,
|
||||
Key: fileName,
|
||||
Body: new File([file], fileName),
|
||||
Body: Buffer.from(await file.arrayBuffer()),
|
||||
}))
|
||||
.then(() => urlForKey(fileName));
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user