<p>Assuming you want the folders to be named after the users' IDs (since they won't change), the subpath should be <code>{id}</code>.</p>

CC BY-SA 3.0
2017-03-27T14:39:06.953Z
Bizarrely, {id} allowed me to save the User with the uploaded Asset, but browsing the Asset section the file I uploaded does not show up in the folder created for the User ID. It's a blank folder. In fact the image doesn't show up anywhere in the Assets section.

[edit] My bad, I hadn't created the folder for the asset.

Thanks!
Matt Wilcox
CC BY-SA 3.0
2017-03-27T14:31:58.617Z
2017-03-27T14:31:58.617Z
Brandon Kelly
<p>Stumbled across this looking for similar reason for error. Went with this in the end, as it adds some folder readability should I need to access uploads by user outside of the CP.</p>
<pre><code>{% if fullName|length %}{fullName|lower}-{% endif %}{id}
</code></pre>

CC BY-SA 4.0
2021-03-31T14:50:31.047Z
2021-03-31T14:50:31.047Z
KevAdamson
<p>when setting a Default Upload Location for a field that’s attached to a User, what’s the variable to use that would ensure the file is uploaded to the User I’m editing’s account in the back end, and not <em>my admin</em> user account - which is what {{currentUser.username}} does?</p>

<p>I haven't been able to find out and everything I've tried hasn't worked. e.g., Could not resolve the subpath “{user.username}”. And {{ user.username }} uploads to a folder for my admin account.</p>

CC BY-SA 3.0
2017-03-24T18:33:43.710Z
Have you tried just `{user}` or if you're in a Matrix block, `{owner.user}`?
Brad Bell
CC BY-SA 3.0
2017-03-27T08:36:52.897Z
Yep; "Could not resolve the subpath “{user}”." is what I get :/
Matt Wilcox
<assets>
Default Upload Location for asset fields on a User...?
# Default Upload Location for asset fields on a User...?

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

when setting a Default Upload Location for a field that’s attached to a User, what’s the variable to use that would ensure the file is uploaded to the User I’m editing’s account in the back end, and not *my admin* user account - which is what {{currentUser.username}} does?

I haven't been able to find out and everything I've tried hasn't worked. e.g., Could not resolve the subpath “{user.username}”. And {{ user.username }} uploads to a folder for my admin account.

**Tags:** assets
> **Comments:**
> **username_1**: Have you tried just `{user}` or if you're in a Matrix block, `{owner.user}`?  
> **username_0**: Yep; "Could not resolve the subpath “{user}”." is what I get :/  

---

## 2 answers

### Answer by username_2 on 2017-03-27. Score: 2 | Accepted answer

Assuming you want the folders to be named after the users' IDs (since they won't change), the subpath should be `{id}`.

> **Comments:**
> **username_0**: Bizarrely, {id} allowed me to save the User with the uploaded Asset, but browsing the Asset section the file I uploaded does not show up in the folder created for the User ID. It's a blank folder. In fact the image doesn't show up anywhere in the Assets section.  [edit] My bad, I hadn't created the folder for the asset.  Thanks!  

---

### Answer by username_3 on 2021-03-31. Score: 1

Stumbled across this looking for similar reason for error. Went with this in the end, as it adds some folder readability should I need to access uploads by user outside of the CP.
{% if fullName|length %}{fullName|lower}-{% endif %}{id}


---

