# How to replace a file within the Asset Manager?

**URL:** https://discourse.getcockpit.com/t/how-to-replace-a-file-within-the-asset-manager/709
**Category:** Support
**Created:** [April 3, 2019, 8:41pm UTC](https://discourse.getcockpit.com/t/how-to-replace-a-file-within-the-asset-manager/709 "2019-04-03T20:41:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![EAllison](https://avatars.discourse-cdn.com/v4/letter/e/b9e5f3/32.png) [@EAllison](https://discourse.getcockpit.com/u/EAllison)
#### Post date: [April 3, 2019, 8:41pm UTC](https://discourse.getcockpit.com/t/how-to-replace-a-file-within-the-asset-manager/709/1 "2019-04-03T20:41:05Z")

</div>

Running Cockpit 0.8.11, and wondering if there’s a way to replace a file with an updated copy from within the Asset Manager. If a file needs replacing, and you attempt to upload a replacement with the same filename, it uploads a new file, with a different hyperlink (/storage/uploads/5ca502fda7c2ftest.pdf for example).

This unfortunately requires you to find/replace all other places you may have used the original, outdated file. Does anyone know if there’s a way to update or replace a file within the Asset Manager?

---

<div class="post-metadata">

### Author: ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)
#### Post date: [April 12, 2019, 8:51am UTC](https://discourse.getcockpit.com/t/how-to-replace-a-file-within-the-asset-manager/709/2 "2019-04-12T08:51:13Z")

</div>

Interesting feature. I would like to have it, too and it shouldn’t be complicated to implement it. Without a GUI, just open a new tab and call

`/assetsmanager/updateAsset?asset[_id]=original_asset_id&asset[path]=/2018/10/18/5bc8727590613replacement.png`

to change the path of the asset.

---

<div class="post-metadata">

### Author: ![gnagnu](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/gnagnu/32/572_2.png) [@gnagnu](https://discourse.getcockpit.com/u/gnagnu)
#### Post date: [September 3, 2020, 10:05pm UTC](https://discourse.getcockpit.com/t/how-to-replace-a-file-within-the-asset-manager/709/3 "2020-09-03T22:05:42Z")

</div>

Hi @EAllison,

Have you been able to find a solution?  
This [commit](https://github.com/agentejo/cockpit/commit/b63202e7100b09ac03b0a0d10f645cc78131c311) shows an updateAssets function which could work @artur ?

Thanks

Hang
