<p>Yes that's totally possible, you just need to set your asset field to upload all assets to a single folder and then you can set a sub-folder path that's created dynamically. (→ <a href="http://buildwithcraft.com/docs/assets-fields#restricting-uploads-to-a-single-folder" rel="nofollow">Restricting Uploads to a Single Folder</a>).</p>

<p>In your case that path would be something like this:</p>

<pre><code>assets/images/projects/{{ object.client.first().friendlyName }}
</code></pre>

<p>or with fallback to a default sub-folder:</p>

<pre><code>{{ object.client.first()|length ? object.client.first().friendlyName : 'Other' }}
</code></pre>

CC BY-SA 3.0
2015-04-09T10:04:57.300Z
2015-04-09T10:04:57.300Z
carlcs
<p>I have a projects section on my website, there can be multiple projects from one client. Each project has at least one image. </p>

<p>I wanted to know if it is possible when uploading assets to a new project entry to be able to create a new subfolder within my specified assets folder for that particular client?</p>

<p>So can I either:</p>

<p>a) Create a subfolder when uploading assets.
b) Use the value of the "client" field to dynamically create a subfolder when uploading images to the entry.</p>

<p>Any help/direction this would be appreciated.</p>

<p>Jay</p>

CC BY-SA 3.0
2015-04-09T10:03:15.037Z
Never mind, n00b moment - figured it out.
toffeejay
<assets>
Create assets subfolder on upload based on entry field value?
# Create assets subfolder on upload based on entry field value?

(Asked by: username_0 on 2015-04-09)

I have a projects section on my website, there can be multiple projects from one client. Each project has at least one image.

I wanted to know if it is possible when uploading assets to a new project entry to be able to create a new subfolder within my specified assets folder for that particular client?

So can I either:

a) Create a subfolder when uploading assets.
b) Use the value of the "client" field to dynamically create a subfolder when uploading images to the entry.

Any help/direction this would be appreciated.

Jay

**Tags:** assets
> **Comments:**
> **username_0**: Never mind, n00b moment - figured it out.  

---

## 1 answers

### Answer by username_1 on 2015-04-09. Score: 1 | Accepted answer

Yes that's totally possible, you just need to set your asset field to upload all assets to a single folder and then you can set a sub-folder path that's created dynamically. (→ Restricting Uploads to a Single Folder).
In your case that path would be something like this:
assets/images/projects/{{ object.client.first().friendlyName }}

or with fallback to a default sub-folder:
{{ object.client.first()|length ? object.client.first().friendlyName : 'Other' }}


---

