janeway icon indicating copy to clipboard operation
janeway copied to clipboard

Long file names result in upload failure

Open alainna opened this issue 1 year ago • 1 comments

Describe the bug During a preprint submission, uploading a file with a 130 character name results in an error:

Storage can not find an available filename for "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx_xxxxxxx._xxxx_xxxx-xxxxx-xxxxxxxxx-xxxxxxxx-xxx-xxx-xxxxxxxxxxx-xx-xxx-xxxx-xxxxxx_xxxxxx". Please make sure that the corresponding file field allows sufficient "max_length".

Original filename: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx_xxxxxxx._xxxx_xxxx-xxxxx-xxxxxxxxx-xxxxxxxx-xxx-xxx-xxxxxxxxxxx-xx-xxx-xxxx-xxxxxx_xxxxxx.pdf

Janeway version 1.4.2.1

To Reproduce Steps to reproduce the behavior:

  1. When submitting a preprint, upload a PDF with a very long filename
  2. See error

Expected behavior PDF would upload and be renamed to something more accessible (eg file ID)

alainna avatar Aug 31 '22 15:08 alainna

For clarification: this bug only occurs when a long file name has a . In the middle and the substring that would be the extension + the length of a UUID4 is greater than 100 characters.

ajrbyers avatar Aug 31 '22 15:08 ajrbyers