# File upload overwrite broken

**URL:** <https://forums.losant.com/t/file-upload-overwrite-broken/4989>\
**Category:** Bug Report\
**Created:** [March 22, 2023, 11:34am UTC](https://forums.losant.com/t/file-upload-overwrite-broken/4989 "2023-03-22T11:34:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [March 22, 2023, 11:34am UTC](https://forums.losant.com/t/file-upload-overwrite-broken/4989/1 "2023-03-22T11:34:44Z")

</div>

Hi there,  
I just noticed if I have an existing file and then I upload a new version.  
The new version is never overwritten e.g. I get the old version.  
I tried even to delete first and then upload.  
Same problem.  
It’s driving me mad, it took me a hour to figure out the issue.

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [March 22, 2023, 1:16pm UTC](https://forums.losant.com/t/file-upload-overwrite-broken/4989/2 "2023-03-22T13:16:38Z")

</div>

I’ve run into this, too and the issue is the original file is still cached on the CDN. It usually takes about five minutes for a file at a given path to start returning a new file at the same path.

One thing you can do to “bust” the cache is to add a query parameter to the end of the file. For example, if the file is at `https://files.onlosant.com/APPLICATION_ID/path/to/file.ext`, add `?something=random` to the end of that. You should then see the newly uploaded file.

You should _not_ do this in your production application experience, as this will slow down delivery of your assets (they will not be returned from cache either in your users’ web browsers or from the CDN).

---

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [March 23, 2023, 6:12pm UTC](https://forums.losant.com/t/file-upload-overwrite-broken/4989/3 "2023-03-23T18:12:03Z")

</div>

Thanks very much for the tip, yes I just need it during testing.  
I would never figured that out by myself!
