mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-17 10:13:56 -05:00

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.