[GH-ISSUE #78] Cannot sign pdf with in filename. #31

Closed
opened 2026-02-26 18:45:03 +03:00 by kerem · 5 comments
Owner

Originally created by @ephraimduncan on GitHub (Apr 15, 2023).
Original GitHub issue: https://github.com/documenso/documenso/issues/78

PDF files containing in their filenames throws an error when the user is about to sign.

To Reproduce

  • Take any pdf file and rename it but include an in the name.
  • Send the pdf to a user and try signing
  • The /documents/[id]/sign page will be stuck on the loading skeleton with the error displayed on the terminal

Error

TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Content-Disposition"]
    at ServerResponse.setHeader (node:_http_outgoing:666:3)
    at _res.setHeader (/Users/duncan/documenso/node_modules/next/dist/server/base-server.js:129:24)
    at getHandler (webpack-internal:///(api)/./pages/api/documents/[id].ts:79:7)
    at async eval (webpack-internal:///(api)/../../packages/lib/server/defaultResponder.ts:12:22)
    at async eval (webpack-internal:///(api)/../../packages/lib/server/defaultHandler.ts:16:5)
    at async Object.apiResolver (/Users/duncan/documenso/node_modules/next/dist/server/api-utils/node.js:367:9)
    at async DevServer.runApi (/Users/duncan/documenso/node_modules/next/dist/server/next-server.js:474:9)
    at async Object.fn (/Users/duncan/documenso/node_modules/next/dist/server/next-server.js:736:37)
    at async Router.execute (/Users/duncan/documenso/node_modules/next/dist/server/router.js:252:36)
    at async DevServer.run (/Users/duncan/documenso/node_modules/next/dist/server/base-server.js:384:29) {
  code: 'ERR_INVALID_CHAR'
}                                                 
Originally created by @ephraimduncan on GitHub (Apr 15, 2023). Original GitHub issue: https://github.com/documenso/documenso/issues/78 PDF files containing `’` in their filenames throws an error when the user is about to sign. ### To Reproduce - Take any pdf file and rename it but include an `’` in the name. - Send the pdf to a user and try signing - The `/documents/[id]/sign` page will be stuck on the loading skeleton with the error displayed on the terminal <details> <summary><h3>Error</h3></summary> ``` TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Content-Disposition"] at ServerResponse.setHeader (node:_http_outgoing:666:3) at _res.setHeader (/Users/duncan/documenso/node_modules/next/dist/server/base-server.js:129:24) at getHandler (webpack-internal:///(api)/./pages/api/documents/[id].ts:79:7) at async eval (webpack-internal:///(api)/../../packages/lib/server/defaultResponder.ts:12:22) at async eval (webpack-internal:///(api)/../../packages/lib/server/defaultHandler.ts:16:5) at async Object.apiResolver (/Users/duncan/documenso/node_modules/next/dist/server/api-utils/node.js:367:9) at async DevServer.runApi (/Users/duncan/documenso/node_modules/next/dist/server/next-server.js:474:9) at async Object.fn (/Users/duncan/documenso/node_modules/next/dist/server/next-server.js:736:37) at async Router.execute (/Users/duncan/documenso/node_modules/next/dist/server/router.js:252:36) at async DevServer.run (/Users/duncan/documenso/node_modules/next/dist/server/base-server.js:384:29) { code: 'ERR_INVALID_CHAR' } ``` </details>
kerem 2026-02-26 18:45:03 +03:00
Author
Owner

@ElTimuro commented on GitHub (Apr 15, 2023):

Noted, low priority for now. The easiest fix would be to disallow the upload of files with that name.

<!-- gh-comment-id:1509891205 --> @ElTimuro commented on GitHub (Apr 15, 2023): Noted, low priority for now. The easiest fix would be to disallow the upload of files with that name.
Author
Owner

@Jared87 commented on GitHub (Sep 5, 2023):

I also noticed this error with umlauts like ä, ö and ü.

<!-- gh-comment-id:1706524440 --> @Jared87 commented on GitHub (Sep 5, 2023): I also noticed this error with umlauts like ä, ö and ü.
Author
Owner

@mittalsam98 commented on GitHub (Sep 26, 2023):

Hey is this issue resolved?

<!-- gh-comment-id:1735680643 --> @mittalsam98 commented on GitHub (Sep 26, 2023): Hey is this issue resolved?
Author
Owner

@ditorodev commented on GitHub (Oct 7, 2023):

I would like to provide a fix for this @ElTimuro if you can point me where in the code this is happening I would add a dictionary that converts special ascii like ä, ö, ü and remove/replace special ascii characters from the name, im sure it is likely something on the parsing which is making it impossible to use these files if their name gets pre-processed before being uploaded/parsed by the backend then this issue can be fixed

EDIT: Seems like theres a fix out there https://github.com/documenso/documenso/pull/275 so can disregard my message

<!-- gh-comment-id:1751670927 --> @ditorodev commented on GitHub (Oct 7, 2023): I would like to provide a fix for this @ElTimuro if you can point me where in the code this is happening I would add a dictionary that converts special ascii like `ä, ö, ü` and remove/replace special ascii characters from the name, im sure it is likely something on the parsing which is making it impossible to use these files if their name gets pre-processed before being uploaded/parsed by the backend then this issue can be fixed EDIT: Seems like theres a fix out there https://github.com/documenso/documenso/pull/275 so can disregard my message
Author
Owner

@Mythie commented on GitHub (Nov 3, 2023):

Closing as this has been solved with our move to the universal upload feature. We're no longer using an endpoint with Content-Disposition so we've completed skipped over this issue 😸

<!-- gh-comment-id:1791898587 --> @Mythie commented on GitHub (Nov 3, 2023): Closing as this has been solved with our move to the universal upload feature. We're no longer using an endpoint with Content-Disposition so we've completed skipped over this issue 😸
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#31
No description provided.