Skip to content

docs: clarify preservePath behavior#1414

Open
vibhor-aggr wants to merge 1 commit into
expressjs:mainfrom
vibhor-aggr:docs/clarify-preservepath-option
Open

docs: clarify preservePath behavior#1414
vibhor-aggr wants to merge 1 commit into
expressjs:mainfrom
vibhor-aggr:docs/clarify-preservepath-option

Conversation

@vibhor-aggr

Copy link
Copy Markdown

Clarifies what preservePath: true does for uploaded file metadata.

The README currently says it keeps the full path instead of the base name, but it does not explain where that path appears or that it is client-supplied input. This adds wording that:

  • identifies file.originalname as the field affected by preservePath;
  • notes that Multer does not create directories or sanitize the path;
  • warns applications to normalize or validate file.originalname before using it in a custom filename or storage engine.

Refs #846.

Verification:

  • npm test (72 passing)
  • npm run lint with HOME pointed at the task workspace because the sandbox home is read-only
  • git diff --check HEAD~1..HEAD

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.

1 participant