Open willprice76 opened 5 years ago
There is a broader issue here. Suffixing of binary file name with TCM URI is done to prevent file name/URL uniqueness issues when all binaries are published in a single location (“Multimedia URL” configured on Publication).
Content Manager also support publishing binaries in Structure Groups (without TCM URI suffix), but this is currently not supported by DXA (neither on CM-side nor in the Web App). This is indeed missing functionality (which ison the backlog).
In general, it should be possible to customize how/where binaries are published and the DXA Web App should be able to deal with binaries which are published in a Structure Group.
It would be good if there was more flexbility in the filename generated for binaries for certain schemas. In our case we want PDF downloads to not have the tcm uri appended, as this is a file that people will download to their local machine.
This could be done by having some further logic in the DefaultModelBuilder and DataModelBuilder when calling the RenderedItem.AddBinary method (this has implementations which allow you to specify the filename).
https://github.com/sdl/dxa-content-management/blob/da4925df268846b16bb29d431383e8728743633e/Sdl.Web.Tridion.Templates.R2/Data/DefaultModelBuilder.cs#L200
https://github.com/sdl/dxa-content-management/blob/da4925df268846b16bb29d431383e8728743633e/Sdl.Web.Tridion.Templates.R2/Data/DataModelBuilder.cs#L348