Change upload size reporting on R2

This commit is contained in:
Sam Becker 2025-03-15 11:19:31 -05:00
parent 53d8b07594
commit 2b9d12d43d

View File

@ -7,7 +7,6 @@ import {
} from '@aws-sdk/client-s3';
import { StorageListResponse, generateStorageId } from '.';
import { removeUrlProtocol } from '@/utility/url';
import { formatBytesToMB } from '@/utility/number';
const CLOUDFLARE_R2_BUCKET =
process.env.NEXT_PUBLIC_CLOUDFLARE_R2_BUCKET ?? '';
@ -95,7 +94,7 @@ export const cloudflareR2List = async (
url: urlForKey(Key),
fileName: Key ?? '',
uploadedAt: LastModified,
size: Size ? formatBytesToMB(Size) : undefined,
size: Size ? `${Size.toFixed(2)}MB` : undefined,
})) ?? []);
export const cloudflareR2Delete = async (Key: string) => {