mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 10:19:51 -06:00
fix: adds maxSize
This commit is contained in:
@@ -166,7 +166,7 @@ describe("service.ts", () => {
|
||||
"Content-Type": "image/jpeg",
|
||||
"Content-Encoding": "base64",
|
||||
},
|
||||
Conditions: undefined,
|
||||
Conditions: [["content-length-range", 0, mockMaxSize]],
|
||||
});
|
||||
|
||||
expect(result.ok).toBe(true);
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { DeleteObjectCommand, GetObjectCommand, HeadObjectCommand } from "@aws-sdk/client-s3";
|
||||
import { type PresignedPostOptions, createPresignedPost } from "@aws-sdk/s3-presigned-post";
|
||||
import {
|
||||
type PresignedPost,
|
||||
type PresignedPostOptions,
|
||||
createPresignedPost,
|
||||
} from "@aws-sdk/s3-presigned-post";
|
||||
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
|
||||
import { logger } from "@formbricks/logger";
|
||||
import {
|
||||
@@ -29,12 +33,12 @@ export const getSignedUploadUrl = async (
|
||||
fileName: string,
|
||||
contentType: string,
|
||||
filePath: string,
|
||||
maxSize?: number
|
||||
maxSize: number = 1024 * 1024 * 10 // 10MB
|
||||
): Promise<
|
||||
Result<
|
||||
{
|
||||
signedUrl: string;
|
||||
presignedFields: PresignedPostOptions["Fields"];
|
||||
presignedFields: PresignedPost["fields"];
|
||||
},
|
||||
UnknownError | S3CredentialsError | S3ClientError
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user