Uploading files with longer file extensions gets truncated

Hi!
when trying to upload a file with “long” file extensions, it seems like the upload filename gets “truncated”


The file I’m trying to upload, which has the “.MaxxECU-Zip-log” file extension.

but links to “/uploads/short-url/3xMz4QHB9JcqXACwwn1S5ZgMi2t.MaxxECU-Zi” which is of course wrong and we get an “oops! that page does not exist or is private”.

Is there anyone who has seen this one before, and has some idea what to change to get this sorted?

Thanks in advance.

4 Likes

All file extensions seem to get “truncated” to max 10 characters.


another file upload example.

2 Likes

I checked the source and it could be the 50 character limit in app\controllers\uploads_controller.rb
line 20

2 Likes

Just wanted to let you know that a fix for this has been created:

https://github.com/discourse/discourse/commit/44153cde18e4f4f3d3c5719e3e7c96b5954f25c8

The issue that I resolved actually was the - and uppercase letters in the extension and not the length. The link to download the file will still be truncated, but the actual file you download will have the full file extension.

5 Likes

Ah, thank you!
Looking forward to the next release then.

2 Likes

This topic was automatically closed after 2 days. New replies are no longer allowed.