# Is it possible to have an automatically updating link to a user's profile picture? Such as by giving each user one "slot" for an avatar?

**URL:** <https://meta.discourse.org/t/is-it-possible-to-have-an-automatically-updating-link-to-a-users-profile-picture-such-as-by-giving-each-user-one-slot-for-an-avatar/209485>\
**Category:** Product Support\
**Created:** [November 18, 2021, 3:17am UTC](https://meta.discourse.org/t/is-it-possible-to-have-an-automatically-updating-link-to-a-users-profile-picture-such-as-by-giving-each-user-one-slot-for-an-avatar/209485 "2021-11-18T03:17:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![orangeandblack5](https://avatars.discourse-cdn.com/v4/letter/o/edb3f5/32.png) [@orangeandblack5](https://meta.discourse.org/u/orangeandblack5)\
**Post date:** [November 18, 2021, 3:17am UTC](https://meta.discourse.org/t/is-it-possible-to-have-an-automatically-updating-link-to-a-users-profile-picture-such-as-by-giving-each-user-one-slot-for-an-avatar/209485/1 "2021-11-18T03:17:52Z")

</div>

We’re trying to set up a “Site Staff” page with info for our admins and moderators, and ideally it would have all of their profile pictures as well. For example:

> # **codinghorror**
> 
> ![](https://global.discourse-cdn.com/meta/original/4X/0/8/2/0824f82e60c5cfd9881cf127b7060f3a06469729.png)  
> **Bio:** I exist  
> **Contact Info:** stuff

However, we don’t want to have to _manually_ update this page any time a staff member changes their profile picture.

There are two ways we can see to go about doing this - whenever a user uploads a new profile picture, directly replace the old one and keep the link the same (which would be preferable we think), or some kind of link that redirects to wherever the user’s current avatar is located.

Any thoughts on the best way to accomplish this? Just copying the link from their current picture does not work as intended from our testing.

> [@orangeandblack5](#):
>
> Plus, the fact that the old profile picture is still saved rather than overwritten by a new one seems disadvantageous for storage reasons anyways. If we could simply give each user one link that their profile picture is stored in, and replace that image if they change it, that seems like it really kills two birds with one stone.

As noted above, it would help storage space if we could just force each user to upload any new profile picture to the same location, which would automatically allow the same link to work as intended and also save storage space.

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [November 18, 2021, 3:28am UTC](https://meta.discourse.org/t/is-it-possible-to-have-an-automatically-updating-link-to-a-users-profile-picture-such-as-by-giving-each-user-one-slot-for-an-avatar/209485/2 "2021-11-18T03:28:06Z")

</div>

> [@orangeandblack5](#):
>
> We’re trying to set up a “Site Staff” page with info for our admins and moderators, and ideally it would have all of their profile pictures as well.

That’s basically the about page isn’t it? Like [About - Discourse Meta](https://meta.discourse.org/about)

> [@orangeandblack5](#):
>
> Any thoughts on the best way to accomplish this?

The _correct_ way of keeping user info synchronized between different system is using [DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/discourseconnect-official-single-sign-on-for-discourse-sso/13045). However that may be too much if all you want is a static page with the current forum admins. In that case you can maybe have a daily/weekly script that parses `/about.json` and updates it?

---

<div class="post-metadata">

**Author:** ![orangeandblack5](https://avatars.discourse-cdn.com/v4/letter/o/edb3f5/32.png) [@orangeandblack5](https://meta.discourse.org/u/orangeandblack5)\
**Post date:** [November 18, 2021, 3:33am UTC](https://meta.discourse.org/t/is-it-possible-to-have-an-automatically-updating-link-to-a-users-profile-picture-such-as-by-giving-each-user-one-slot-for-an-avatar/209485/3 "2021-11-18T03:33:02Z")

</div>

Yeah, we’re more than happy with having users register on the actual site, so SSO seems a bit overkill. As for the about page, the issue with that is there’s no place for a bio or outside contact info, which really kills its ability to be a one-stop shop. We also imagine it might be harder to add all of this to the about page than to get an updating image working on another page.

A script isn’t a bad idea, although an instant response time would obviously be better if possible - it’s helpful for a user to be able to visually connect the profile picture with the status, and it could be disorienting to new users if the picture on the page and in use don’t match.

Plus, the fact that the old profile picture is still saved rather than overwritten by a new one seems disadvantageous for storage reasons anyways. If we could simply give each user one link that their profile picture is stored in, and replace that image if they change it, that seems like it really kills two birds with one stone.

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [November 18, 2021, 4:01am UTC](https://meta.discourse.org/t/is-it-possible-to-have-an-automatically-updating-link-to-a-users-profile-picture-such-as-by-giving-each-user-one-slot-for-an-avatar/209485/4 "2021-11-18T04:01:53Z")

</div>

> [@orangeandblack5](#):
>
> outside contact info

There is a site setting to add an external contact method to the about page.

> [@orangeandblack5](#):
>
> an instant response time would obviously be better if possible

Didn’t mean for the about page to be parsed on your page rendering process, but in a background task and only periodically.

This depends on what tech you use to build said page. For example if you are on the JAMstack, this makes sense on the compilation phase. If it’s a Rails app, maybe an Active Job that runs daily and updates your local cache in the database.

> [@orangeandblack5](#):
>
> Plus, the fact that the old profile picture is still saved rather than overwritten by a new one seems disadvantageous for storage reasons anyways.

We call those orphaned uploads, and they are cleaned up after a few days automatically via a background task.

---

<div class="post-metadata">

**Author:** ![orangeandblack5](https://avatars.discourse-cdn.com/v4/letter/o/edb3f5/32.png) [@orangeandblack5](https://meta.discourse.org/u/orangeandblack5)\
**Post date:** [November 18, 2021, 4:11am UTC](https://meta.discourse.org/t/is-it-possible-to-have-an-automatically-updating-link-to-a-users-profile-picture-such-as-by-giving-each-user-one-slot-for-an-avatar/209485/5 "2021-11-18T04:11:11Z")

</div>

> [@Falco](#):
>
> We call those orphaned uploads, and they are cleaned up after a few days automatically via a background task.

Would it make more sense to simply replace the orphaned upload with a new upload?

Seems to me to be a win-win but I’m not a web developer so it’s possible I’m overlooking something.
