# Retrieve profile image to display on external site

**URL:** https://meta.discourse.org/t/retrieve-profile-image-to-display-on-external-site/40624
**Category:** Development
**Created:** [5 maart 2016 om 18:42 UTC](https://meta.discourse.org/t/retrieve-profile-image-to-display-on-external-site/40624 "2016-03-05T18:42:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ian\_Hitchcox](https://avatars.discourse-cdn.com/v4/letter/i/7c8e57/32.png) [@Ian\_Hitchcox](https://meta.discourse.org/u/Ian_Hitchcox)
#### Post date: [5 maart 2016 om 18:42 UTC](https://meta.discourse.org/t/retrieve-profile-image-to-display-on-external-site/40624/1 "2016-03-05T18:42:10Z")

</div>

Hi

I want to grab a user’s image from our discourse forum and be able to consume it via JS or the Java Spring backend.

I currently get a cross origin error when doing a standard ajax call for the image.

Is it possible to do it this way?

Currently trying:  
`'http://forum.oursitename.com/user_avatar/forum.oursitename.com/' + playerName + '/120/1079_1.png'`

Thanks

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [5 maart 2016 om 21:49 UTC](https://meta.discourse.org/t/retrieve-profile-image-to-display-on-external-site/40624/2 "2016-03-05T21:49:36Z")

</div>

See the `cors origins` setting:

> [@](#):
>
> Allowed origins for cross-origin requests (CORS). Each origin must include http:// or https://. The DISCOURSE\_ENABLE\_CORS env variable must be set to true to enable CORS.

---

<div class="post-metadata">

### Author: ![Ian\_Hitchcox](https://avatars.discourse-cdn.com/v4/letter/i/7c8e57/32.png) [@Ian\_Hitchcox](https://meta.discourse.org/u/Ian_Hitchcox)
#### Post date: [7 maart 2016 om 16:11 UTC](https://meta.discourse.org/t/retrieve-profile-image-to-display-on-external-site/40624/3 "2016-03-07T16:11:42Z")

</div>

Thanks a lot 🙂  
This fixed our issue.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [25 december 2018 om 23:58 UTC](https://meta.discourse.org/t/retrieve-profile-image-to-display-on-external-site/40624/4 "2018-12-25T23:58:41Z")

</div>



---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [26 december 2018 om 08:29 UTC](https://meta.discourse.org/t/retrieve-profile-image-to-display-on-external-site/40624/5 "2018-12-26T08:29:44Z")

</div>


