5

I have a user uploading this PDF file to the media library: Predictability_of_outcomes_in_discovery_disputes_at_cbca_improves_over_cbcas_first_ten_years_with_trend_toward_public.pdf. The filename clocks in at 121 characters according to Word's counter. This is going in a folder structure where the URL ends up being /-/media/Files/Corporate/Publications/2017/07. If I shorten the PDF file name, it imports with the underscores intact, but if I import the filename as you see it, the underscores are removed automatically.

Is there any way in Sitecore to extend the file name length it can take? Is this something to do with a length limit on the item name that's created to correspond, hence the change?

  • Can you shorten the item name and update the display name with the long name? – Chris Auer Jul 14 '17 at 21:07
7

The issue you are facing is that you are hitting the MaxItemNameLength length, which by default is 100:

<!--
  MAX ITEM NAME
            Specifies the maximum length of an item name.
            Default value: 100

-->
<setting name="MaxItemNameLength" value="100"/>

Sitecore will "sanitize" the item name based on the file uploaded to ensure it meets various criteria (MaxItemNameLength and InvalidItemNameChars), if not it will strip those characters and shorten the item name.

Either increase this to a higher value or shorten the name of the media item that is uploaded.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.