Updating file references in assets via the CM API

adamadam Member ✭✭
edited December 2017 in Back-end Development


I need to perform a bulk change to many assets converting to JPG from PNGs due to some changing requirements on my end. It seems straight forward to just upload a new binary, and upsert the new file_reference on the asset, but I wanted to check:

  • What happens to orphaned binaries? Do they eventually get cleaned up, do they contribute against quotas? Is there any way for me to delete them?
  • Are there performance concerns if a large number is relinked like this? If so, approximately what would be the scale where I would see issues?



  • Hi Adam,

    Currently it's NOT possible to switch the binary. However, we do have a story that will make it possible from both CM API and the UI :) When do you need to convert those assets?

    We plan to implement it so you don't need to worry about the orphaned binaries. They will stay in the storage and will be cleaned up eventually. They are not counted towards any quota.

    It's hard to talk about performance given the fact that the functionality is not implemented but AFAIK should be comparable to a situation when you need to create new assets.

    Jirka, Kentico Cloud team

  • adamadam Member ✭✭

    Thanks for the update Jirka.

    When you say it's not possible to switch the binary, do you mean not possible to update the binary uploaded, or not possible to upsert the asset to point to a new binary file reference? (I was hoping the later would be possible.)

    I'll need to convert those assets soon, but could wait if it's clear the story is on the close horizon... otherwise I'll just create new assets/binaries if the upsert technique does not work.


  • Hi Adam,

    Both mentioned methods are not possible at the moment. We will implement the second one (updating the asset with new file reference). The story is currently number five in our UX improvement backlog but I'll try tu push it higher based on your imminent need :) I presume that it would be OK for you to have this feature available in the CM API only?


  • Also, we plan to enable this feature only for assets that are not used in any published content. Is that OK for you, Adam?

  • adamadam Member ✭✭

    Hi Jirka,

    I do have an imminent need, but with the holidays coming up, and since it looks like it won't be possible to do soon, I'll look at just uploading new assets altogether. I appreciate the feedback.

    As far as feedback on only enabling the feature not used in published content and only being available via the CM API, that seems reasonable.


  • ralphralph Member

    @GeorgeKay said:
    Also, we plan to enable this feature only for assets that are not used in any published content. Is that OK for you, Adam?

    I also just bumped into this issue. We would like to be able to update the file reference even if the content is currently published.

    It is a common scenario that i.e. already published artwork should be replaced with a new photo or updated photo.

    There should simply be a "update" button, that allows the user to replace an existing photo with something else.

    I can see the impact, if allowed artwork is size restricted, a user could bypass these restrictions, however, if every time you want to replace a photo, you have to re-publish the page as well, this might be very cumbersome.

Sign In or Register to comment.