Attachment loses its file extension when length of the filename exceeds the limit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2014 08:41 AM
Is there a way to keep the file extension when a user puts an attachment with a filename that exceeds the limit set in ServiceNow?
I know we can change the maximum lenght of the filename in the sys_attachment table, but that's not what I want. I would like to cut the filename to the default 100 caracters limit, but to keep its file extension. This way, although the filename has been truncated, our users will still be able to open it.
Thanks!
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2015 10:16 AM
hmm the docx extension works fine when the length is < 100
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2015 10:45 AM
+edit made to max_length
Can you try changing the the dictionary entry for the file_name to max length=254.
I remember reading somewhere that this is the maximum it can be for the field type 'string'. if you need to go bigger you have to change the field type.
Once you have changed it, try attaching a file with a name >100 characters but <254 - and see if it shows the extension.
I'm just looked at my test instance (Eureka patch 😎 and I see two attachment tables:
sys_attachment
sys_attachment2
Which one are you using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2015 10:56 AM
I am using sys_attachment table. I modified the file_name field max length to 260. Now when I try to reduce the max length, it wonnot let me do for some reason.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2015 11:03 AM
At this point i would clone to get my tables back to where they were before you made the changes - hopefully you're doing this on a test instance
Or you can open a Hi request...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2015 11:07 AM
YOu are correct .. 254 did the trick.