diff --git a/app/routes/report.tsx b/app/routes/report.tsx index fee2b82..eaba642 100644 --- a/app/routes/report.tsx +++ b/app/routes/report.tsx @@ -42,6 +42,22 @@ export default function () { const toast = useToast(); const [uploading, setUploading] = useState(false); const [turnstileToken, setTurnstileToken] = useState(""); + const fileTypes: { [k: string]: string } = { + gif: "image/gif", + heic: "image/heic", + heif: "image/heif", + jfif: "image/jpeg", + jpeg: "image/jpeg", + jpg: "image/jpg", + m4v: "video/x-m4v", + mkv: "video/x-matroska", + mov: "video/quicktime", + mp4: "video/mp4", + png: "image/png", + webp: "image/webp", + webm: "video/webm", + wmv: "video/x-ms-wmv", + }; useEffect(() => { if (sessionStorage.getItem("REPORT_SUCCESS")) { @@ -164,7 +180,9 @@ export default function () { // @ts-expect-error duplex: supportsRequestStreams ? "half" : undefined, headers: { - "content-type": file.type, + "content-type": + file.type || + fileTypes[file.name.split(".")[file.name.split(".").length - 1]], }, method: "PUT", }).catch(console.error);