Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: enable DOCX file support for visitor uploads in dataroom

Cursor Agent7194c3d14863
diff --git a/components/viewer-upload-component.tsx b/components/viewer-upload-component.tsx
index 35a5a32c..3316ccf2 100644
--- a/components/viewer-upload-component.tsx
+++ b/components/viewer-upload-component.tsx
@@ -78,7 +78,7 @@ export function ViewerUploadComponent({
<div className="rounded-lg border-2 border-dashed border-gray-300 p-8 text-center">
<p>Drag & drop files here, or click to select files</p>
<p className="mt-2 text-sm text-gray-500">
- Supported file types: PDF, Excel, CSV
+ Supported file types: PDF, Word, Excel, CSV
</p>
{/* Display current uploads */}
diff --git a/components/viewer-upload-zone.tsx b/components/viewer-upload-zone.tsx
index c9df2bb8..19e72e1d 100644
--- a/components/viewer-upload-zone.tsx
+++ b/components/viewer-upload-zone.tsx
@@ -47,7 +47,7 @@ export default function ViewerUploadZone({
if (errors.find(({ code }) => code === "file-too-large")) {
message = `File size too big (max. ${maxFileSize} MB).`;
} else if (errors.find(({ code }) => code === "file-invalid-type")) {
- message = `File type not supported. Please upload PDF or Excel files.`;
+ message = `File type not supported. Please upload PDF, Word, or Excel files.`;
}
return { fileName: file.name, message };
});
@@ -186,7 +186,7 @@ export default function ViewerUploadZone({
Drop your file(s) here
</span>
<p className="mt-1 text-xs leading-5 text-muted-foreground">
- Only *.pdf, *.xls, *.xlsx, *.csv, *.tsv, *.ods files
+ Only *.pdf, *.doc, *.docx, *.xls, *.xlsx, *.csv, *.ods files
</p>
</div>
</div>
diff --git a/lib/constants.ts b/lib/constants.ts
index f5b5f849..0f74d505 100644
--- a/lib/constants.ts
+++ b/lib/constants.ts
@@ -164,6 +164,8 @@ export const VIEWER_ACCEPTED_FILE_TYPES = {
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [], // ".xlsx"
"text/csv": [], // ".csv"
"application/vnd.oasis.opendocument.spreadsheet": [], // ".ods"
+ "application/msword": [], // ".doc"
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [], // ".docx"
"image/jpeg": [], // ".jpg"
"image/png": [], // ".png"
"image/jpg": [], // ".jpg"