fix: remove ContentLength from presigned URL, fix macOS multi-select
- ContentLength in PutObjectCommand causes XHR upload failures (browser does not send matching Content-Length header in presigned PUT requests) - Change accept to audio/* so macOS Finder allows multi-file selection - Add step prefix to errors ([URL]/[S3]/[DB]) for easier debugging Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,13 +21,12 @@ const bucket = process.env.S3_BUCKET!;
|
||||
export async function createUploadUrl(
|
||||
key: string,
|
||||
contentType: string,
|
||||
maxSize: number,
|
||||
_maxSize?: number,
|
||||
): Promise<string> {
|
||||
const command = new PutObjectCommand({
|
||||
Bucket: bucket,
|
||||
Key: key,
|
||||
ContentType: contentType,
|
||||
ContentLength: maxSize,
|
||||
});
|
||||
return getSignedUrl(s3, command, { expiresIn: 900 }); // 15 min
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user