mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
block non pdf upload
This commit is contained in:
@ -6,7 +6,12 @@ export const uploadDocument = async (event: any) => {
|
||||
if (event.target.files && event.target.files[0]) {
|
||||
const body = new FormData();
|
||||
const document = event.target.files[0];
|
||||
const fileName = event.target.files[0].name;
|
||||
const fileName: string = event.target.files[0].name;
|
||||
|
||||
if (!fileName.endsWith(".pdf")) {
|
||||
toast.error("Non-PDF documents are not supported yet.");
|
||||
return;
|
||||
}
|
||||
body.append("document", document || "");
|
||||
const response: any = await toast
|
||||
.promise(
|
||||
|
||||
Reference in New Issue
Block a user