Patch #24186
closedRestrict the length attachment filenames on disk
0%
Description
When uploading a file with a very long name, the disk_filename
might be too long to be stored on the server's filesystem.
Since Redmine always prepends the timestamp to the name of the uploaded file, the final disk_filename
will be longer than 255 characters (the common limit for filenames on most file systems) if the original filename is between 240 and 255 characters long. If that is the case, the attachment save will fail with a Errno::ENAMETOOLONG
exception when attempting to write the file to disk.
The attached patch by Planio fixes this behavior by restricting the length of the filename 50 characters (to have some breathing room on unusual file systems). In that case, we just use the ASCII fallback we already have in place.
Files
Updated by Toshi MARUYAMA almost 8 years ago
- Category set to Attachments
- Target version set to 3.4.0
Updated by Jean-Philippe Lang almost 8 years ago
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
Committed, thanks.