Skip to content

docs: make the upload examples safe to copy - #6

Merged
muhammetsafak merged 2 commits into
mainfrom
docs/fix-unsafe-examples
Nov 24, 2026
Merged

muhammetsafak merged 2 commits into
mainfrom
docs/fix-unsafe-examples

Conversation

@muhammetsafak

Copy link
Copy Markdown
Contributor

Summary

Documentation-only change: examples that could be copied into an application in an unsafe form are corrected.

  • Set allowed_extensions and allowed_mime_types in every adapter example, including FTP and the Quick Start backend switch
  • Generate the stored name with rename() instead of keeping the client file name, and store under a directory outside the web root
  • HTML-escape the stored URL when it is echoed; make the PDF recipe reject unexpected files instead of storing them elsewhere

Notes

  • Only docs/ and README.md change; src/, tests and CI are untouched, and library behavior is unchanged.
  • wiki-sync.sh --check docs passes.

- Set `allowed_extensions` and `allowed_mime_types` in every adapter example, including FTP and the Quick Start backend switch
- Generate the stored name with `rename()` instead of keeping the client file name, and store under a directory outside the web root
- HTML-escape the stored URL when it is echoed; make the PDF recipe reject unexpected files instead of storing them elsewhere
- Pass the same extension, MIME and size options in the FTPS example and the exception-handling snippet
@muhammetsafak
muhammetsafak merged commit 6f54b24 into main Nov 24, 2026
9 checks passed
@muhammetsafak
muhammetsafak deleted the docs/fix-unsafe-examples branch November 24, 2026 05:09
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