Antoine Merino b0d2cda34a
Fix: Ensure export filenames fit within 143-character limit
The eCryptfs filesystem imposes a filename length limit of 143 characters.
This limit still applies on some systems, such as Synology and QNAP NAS devices when using encrypted folders.

When saving documents with long names, Paperless-ngx triggers a warning (`[Errno 36] File name too long`),
but it gracefully falls back to a default or truncated name.

However, the `document_exporter` crashes when encountering such filenames during export.

This change ensures that exported document base names are capped at 120 characters,
leaving room for extensions and suffixes and keeping the total filename length within 143 characters.

Using the document exported with the "--delete" parameter will take care of eventual old files with a long name, if the filesystem supported it.
2025-03-07 01:48:17 +01:00
..
2024-02-02 07:39:06 -08:00