diff --git a/api.planx.uk/modules/file/service/uploadFile.ts b/api.planx.uk/modules/file/service/uploadFile.ts index ead3cee9af..a6ee74227b 100644 --- a/api.planx.uk/modules/file/service/uploadFile.ts +++ b/api.planx.uk/modules/file/service/uploadFile.ts @@ -79,9 +79,9 @@ export function generateFileParams( ACL: "public-read", Bucket: process.env.AWS_S3_BUCKET, Key: key, - Body: file.buffer, + Body: file.buffer || JSON.stringify(file), ContentDisposition: `inline;filename="${filename}"`, - ContentType: file.mimetype, + ContentType: file.mimetype || "application/json", }; return {