Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

fix: allow mov

Nevo Daviddcb5b09e0ec6
diff --git a/libraries/nestjs-libraries/src/upload/r2.uploader.ts b/libraries/nestjs-libraries/src/upload/r2.uploader.ts
index 3164d5ed8..f753c4967 100644
--- a/libraries/nestjs-libraries/src/upload/r2.uploader.ts
+++ b/libraries/nestjs-libraries/src/upload/r2.uploader.ts
@@ -232,9 +232,15 @@ export async function completeMultipartUpload(req: Request, res: Response) {
const prefix = Buffer.concat(chunks);
const detected = await fileTypeFromBuffer(prefix);
- // a .mov with an ISO brand sniffs as video/mp4; the normalizer reads both
+ // .mov and .mp4 are the same ISO BMFF family: a .mov with an ISO brand
+ // sniffs as video/mp4 and a QuickTime-brand file is often named .mp4.
+ // The normalizer reads both and always writes an mp4, so accept both
+ // for either extension whenever it is on; without it .mp4 stays strict.
const acceptedMimes =
- safeExt === '.mov' ? ['video/quicktime', 'video/mp4'] : [expectedMime];
+ UploadFactory.processorEnabled() &&
+ (safeExt === '.mov' || safeExt === '.mp4')
+ ? ['video/quicktime', 'video/mp4']
+ : [expectedMime];
if (!detected || !acceptedMimes.includes(detected.mime)) {
await R2.send(
new DeleteObjectCommand({ Bucket: CLOUDFLARE_BUCKETNAME, Key: key })