XF 2.2 Any way to use the attachments file extension instead of attachment ID

JoyFreak

Well-known member
Currently, attachments use the attachment ID as the extension of the file so an attachment of MyPicture.jpg ends up MyPicture-jpg.123. Is there any way to use the attachments file extension instead of attachment ID?
 
The ID is the unique identifier.

If there were two images entitled 'MyPicture.jpg' how would the system know which one to serve?

There are no options related to it though - it would require custom development.
 
As Brogan already pointed out, the ID is required to identify the attachment - the filename (which is used to generate the slug) is not necessarily unique.

It would be possible to change the slug format with custom code, but keep in mind that this would make the URL inconsistent with other XenForo URLs which are usually /prefix/<title>.<id>.
 
The ID is the unique identifier.

If there were two images entitled 'MyPicture.jpg' how would the system know which one to serve?

There are no options related to it though - it would require custom development.
Well it can add the ID after the filename and keep the file extension at the end, like this: MyPicture-123.jpg

As Brogan already pointed out, the ID is required to identify the attachment - the filename (which is used to generate the slug) is not necessarily unique.

It would be possible to change the slug format with custom code, but keep in mind that this would make the URL inconsistent with other XenForo URLs which are usually /prefix/<title>.<id>.

Is it possible to have it like I mentioned above and if so, how? Can it be made by a simple template edit?
 
Back
Top Bottom