<p>I don't think the <code>/Applications/MAMP/htdocs/craft/storage/runtime/assets/sources/</code> log entries are related to the request when <code>getResourceUrl()</code> is called.  Of if they are, they are elsewhere in the request and not as a direct result of calling <code>getResourceUrl</code>()`.</p>

<p>The error in the console seems like the one to investigate.  Based on <code>net::ERR_CONNECTION_REFUSED</code>, I'd check to make sure that <code>craft/storage</code> is recursively writable by PHP as a starting point.</p>

CC BY-SA 3.0
2017-04-25T10:48:14.447Z
I've checked the permissions and all seems fine here. Even used `chmod -R 777 /Applications/MAMP/htdocs/craft/storage` to confirm.
Remco
CC BY-SA 3.0
2017-04-24T23:50:32.833Z
2017-04-24T23:50:32.833Z
Brad Bell
<p>@cole sorted it! I am hosting craft locally and my localhost used the port number as part of it's URL. I switched the ports to <code>80/81/3306</code> which took the <code>8888</code> port out of the url and also loaded all images.</p>

CC BY-SA 3.0
2017-04-25T13:16:45.913Z
2017-04-25T13:16:45.913Z
Remco
<p>I am trying to load user profile pictures (the Craft ones), but they don't load. The <code>getPhotoUrl()</code> seems to point to the wrong folder(?).</p>

<p>The profile images seem to be stored in the userprofiles folder by default</p>

<pre><code>{% set users = craft.users %}

{% for user in users %}
    &lt;div class="searchresults"&gt;&lt;a href="/profile/{{ user }}"&gt;{{ user }}&lt;/a&gt;

    {% if user.getPhotoUrl %}
        &lt;img src="{{ user.getPhotoUrl(64) }}" class="profile_search_picture" alt="{{ entry.user.getFullName }}"/&gt;
    {% else %}
        &lt;img src="/img/fallback.png" class="profile_search_picture" alt="{{ entry.user.getFullName }}"/&gt; 
    {% endif %}

&lt;/div&gt;
{% endfor %}
</code></pre>

<hr>

<blockquote>
  <p>2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/sources/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/field_3/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/field_4/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/user_1/field_3/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/user_1/field_4/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/temp/uploads/userphotos/harry/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/temp/uploads/userphotos/remco/, but could not.</p>
</blockquote>

<hr>

<p>the console gives this error</p>

<pre><code>GET http://localhost/cpresources/userphotos/remco/64/17492405_10212330524487585_7776812525773615973_o.jpg?x=UoEZXg1dH net::ERR_CONNECTION_REFUSED
</code></pre>

<redirect><user-profile>
Why does {{ user.getPhotoUrl(64) }} point towards storage/runtime and not to storage/userprofiles?
# Why does {{ user.getPhotoUrl(64) }} point towards storage/runtime and not to storage/userprofiles?

(Asked by: username_0 on 2017-04-24)

I am trying to load user profile pictures (the Craft ones), but they don't load. The getPhotoUrl() seems to point to the wrong folder(?).
The profile images seem to be stored in the userprofiles folder by default
{% set users = craft.users %}

{% for user in users %}
    {{ user }}

    {% if user.getPhotoUrl %}
        
    {% else %}
         
    {% endif %}


{% endfor %}



2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/sources/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/field_3/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/field_4/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/user_1/field_3/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/user_1/field_4/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/temp/uploads/userphotos/harry/, but could not.
  2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/temp/uploads/userphotos/remco/, but could not.


the console gives this error
GET http://localhost/cpresources/userphotos/remco/64/17492405_10212330524487585_7776812525773615973_o.jpg?x=UoEZXg1dH net::ERR_CONNECTION_REFUSED

**Tags:** redirect, user-profile


---

## 2 answers

### Answer by username_1 on 2017-04-24. Score: 1

I don't think the `/Applications/MAMP/htdocs/craft/storage/runtime/assets/sources/` log entries are related to the request when `getResourceUrl()` is called. Of if they are, they are elsewhere in the request and not as a direct result of calling `getResourceUrl`()`.

The error in the console seems like the one to investigate. Based on `net::ERR_CONNECTION_REFUSED`, I'd check to make sure that `craft/storage` is recursively writable by PHP as a starting point.

> **Comments:**
> **username_0**: I've checked the permissions and all seems fine here. Even used `chmod -R 777 /Applications/MAMP/htdocs/craft/storage` to confirm.  

---

### Answer by username_0 on 2017-04-25. Score: 1

@cole sorted it! I am hosting craft locally and my localhost used the port number as part of it's URL. I switched the ports to `80/81/3306` which took the `8888` port out of the url and also loaded all images.


---

