<p>Can I ask why you can't change the filename to the old one? For the new file that is. That will easily solve the problem.</p>

<p>The reason it won't show up as per the new file name is that when you upload a profile photo for a user, craft creates a image model for it and when copying over a file directly this image model will not be created hence you either need to use the backend for uploading profile photos or change the filename to the old one. Also you would need to do this in multiple folders as inside <code>userphotos/{username}/</code> you will see that there are multiple folders, these are folders for different cropped sizes of the profile photo and will be displayed in different locations, Hence you will need to replace the file in all of these locations for the user photo to appear correctly in all places.</p>

CC BY-SA 3.0
2015-01-29T02:19:35.737Z
2015-01-29T02:19:35.737Z
Moin Qidwai
<p>I recently updated some of the photos for a user group. I'm using the default user photo field. </p>

<p>I'm displaying the user photos on the front-end of my site and the images were displaying just fine. After replacing the images the image tag on the front-end of my site is showing a broken image. If I view the image tag <code>src</code> it points to the old image filename, not the updated file's filename. </p>

<p>I have cleared Craft's cache. </p>

<p>How I can make <code>getPhotoUrl()</code> use the new filename?</p>

CC BY-SA 3.0
2015-02-03T19:28:07.713Z
The image in the CP updates to the new image. But the image on the front-end still points to the old image filename.
Brett DeWoody
CC BY-SA 3.0
2015-01-28T21:33:19.733Z
Did you clear *all* caches?  Specifically, if the photo is in `{% cache %}` tags, you'll need to clear the template caches.
Brad Bell
CC BY-SA 3.0
2015-01-28T21:37:44.763Z
I have cleared all caches via the Clear Caches tool.
Brett DeWoody
CC BY-SA 3.0
2015-01-29T02:20:08.013Z
Just tried a test locally and I'm not able to reproduce. The profile image updated successfully. In the `craft_users` table what's the value of the `photo` column for the user?
Brad Bell
<assets><users>
User photos not showing after replacing photo
# User photos not showing after replacing photo

(Asked by: username_0 on 2015-01-28)

I recently updated some of the photos for a user group. I'm using the default user photo field.

I'm displaying the user photos on the front-end of my site and the images were displaying just fine. After replacing the images the image tag on the front-end of my site is showing a broken image. If I view the image tag `src` it points to the old image filename, not the updated file's filename.

I have cleared Craft's cache.

How I can make `getPhotoUrl()` use the new filename?

**Tags:** assets, users
> **Comments:**
> **username_1**: Did you clear *all* caches?  Specifically, if the photo is in `{% cache %}` tags, you'll need to clear the template caches.  
> **username_0**: I have cleared all caches via the Clear Caches tool.  
> **username_1**: Just tried a test locally and I'm not able to reproduce. The profile image updated successfully. In the `craft_users` table what's the value of the `photo` column for the user?  
> **username_0**: The image in the CP updates to the new image. But the image on the front-end still points to the old image filename.  

---

## 1 answers

### Answer by username_2 on 2015-01-29. Score: 1

Can I ask why you can't change the filename to the old one? For the new file that is. That will easily solve the problem.

The reason it won't show up as per the new file name is that when you upload a profile photo for a user, craft creates a image model for it and when copying over a file directly this image model will not be created hence you either need to use the backend for uploading profile photos or change the filename to the old one. Also you would need to do this in multiple folders as inside `userphotos/{username}/` you will see that there are multiple folders, these are folders for different cropped sizes of the profile photo and will be displayed in different locations, Hence you will need to replace the file in all of these locations for the user photo to appear correctly in all places.


---

