Skip to content

Visitor file upload limits#2104

Open
mfts wants to merge 2 commits intomainfrom
cursor/visitor-file-upload-limits-fec7
Open

Visitor file upload limits#2104
mfts wants to merge 2 commits intomainfrom
cursor/visitor-file-upload-limits-fec7

Conversation

@mfts
Copy link
Owner

@mfts mfts commented Mar 7, 2026

Increase data room visitor file upload size limit and expand accepted file types.

Data room visitors with file requests enabled on Data Rooms Plus plans now have a file size limit of 350MB (matching admin limits) and can upload a broader range of file types, excluding audio, video, CAD, geo, and markdown files. This enhances the visitor experience by providing more flexibility for file submissions.


Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Expanded supported file types to include Office documents, presentations, plain text files, ZIP archives, and Outlook messages.
  • Chores

    • Increased maximum file upload size limit to 350 MB.
    • Updated upload interface messaging to reflect expanded file format support.

cursoragent and others added 2 commits March 6, 2026 10:59
…om file requests

- Increase visitor file size limit from 30MB to 350MB to match paid admin limits
  (file requests are only available on Data Rooms Plus plan)
- Expand VIEWER_ACCEPTED_FILE_TYPES to include all admin file types except
  audio and video: adds PowerPoint, Keynote, ODP, ODT, RTF, TXT, Markdown,
  CAD (DWG/DXF), ZIP, TSV, XLSM, KML/KMZ, and Outlook MSG
- Update UI help text to reflect broader file type support

Co-authored-by: Marc Seitz <mfts@users.noreply.github.com>
Co-authored-by: Marc Seitz <mfts@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Mar 7, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Mar 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
papermark Ready Ready Preview, Comment Mar 7, 2026 1:59am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

Walkthrough

The PR expands supported file types for document uploads by increasing the maximum file size limit to 350 MB, updating UI messaging, removing specialized handling for CAD and map files, and adding MIME type entries for Office documents, presentations, plain text, RTF, and archives.

Changes

Cohort / File(s) Summary
Upload Components
components/viewer-upload-component.tsx, components/viewer-upload-zone.tsx
Updated descriptive text to reflect expanded file type support; increased default maxFileSize from 30 MB to 350 MB; simplified error messages; removed special handling for CAD (.dwg/.dxf) and map (.kml/.kmz) files; changed UI hints to broader category descriptions.
File Type Configuration
lib/constants.ts
Expanded VIEWER_ACCEPTED_FILE_TYPES constant with 14 new MIME type mappings including Office formats (PowerPoint, Excel macros), presentations (Keynote, ODP), plain text, RTF, ZIP archives, and Outlook messages (.msg); reorganized and relabeled existing entries.

Possibly related PRs

  • PR #1793: Expands VIEWER\_ACCEPTED\_FILE\_TYPES with RTF and plain text MIME types and updates viewer upload zone to consume the shared constant.
  • PR #2063: Updates file-type mappings in constants and modifies upload UI text to advertise additional document types like Word formats.
  • PR #1666: Adds support for "application/vnd.ms-outlook" (.msg) MIME type in accepted file handling.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Visitor file upload limits' is partially related to the changeset but refers only to the max file size increase, not the main point of expanded file type support.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/viewer-upload-zone.tsx`:
- Line 26: The client-side PDF page counting in ViewerUploadZone (where
file.arrayBuffer() and getPagesCount are called) can OOM for large files; add a
size gate (e.g., const MAX_CLIENT_PDF_PAGECOUNT_MB = 50) and only call
file.arrayBuffer() + getPagesCount when file.type === "application/pdf" &&
file.size <= MAX_CLIENT_PDF_PAGECOUNT_MB * 1024 * 1024, otherwise set numPages =
1 (or defer counting to the server); update the logic around the existing
file.arrayBuffer()/getPagesCount usage to use this guard to prevent buffering
>50MB PDFs in the browser.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f28513f3-eb90-4a76-b42e-4c408c8d6749

📥 Commits

Reviewing files that changed from the base of the PR and between 3cf4458 and 3431d1d.

📒 Files selected for processing (3)
  • components/viewer-upload-component.tsx
  • components/viewer-upload-zone.tsx
  • lib/constants.ts

viewerData,
teamId,
maxFileSize = 30, // 30 MB default
maxFileSize = 350, // 350 MB default, matches paid admin document limits
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid client-side page counting on 350 MB PDFs.

With the new default, the existing PDF path on Lines 79-81 now buffers the entire file via file.arrayBuffer() before upload. A 300+ MB PDF is enough to freeze or crash the tab on lower-memory devices. Please gate client-side page counting behind a much smaller threshold or move it server-side.

Possible direction
const MAX_CLIENT_PDF_PAGECOUNT_MB = 50;

let numPages = 1;
if (
  file.type === "application/pdf" &&
  file.size <= MAX_CLIENT_PDF_PAGECOUNT_MB * 1024 * 1024
) {
  const buffer = await file.arrayBuffer();
  numPages = await getPagesCount(buffer);
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/viewer-upload-zone.tsx` at line 26, The client-side PDF page
counting in ViewerUploadZone (where file.arrayBuffer() and getPagesCount are
called) can OOM for large files; add a size gate (e.g., const
MAX_CLIENT_PDF_PAGECOUNT_MB = 50) and only call file.arrayBuffer() +
getPagesCount when file.type === "application/pdf" && file.size <=
MAX_CLIENT_PDF_PAGECOUNT_MB * 1024 * 1024, otherwise set numPages = 1 (or defer
counting to the server); update the logic around the existing
file.arrayBuffer()/getPagesCount usage to use this guard to prevent buffering
>50MB PDFs in the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants