Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-09T10:04:57.300Z
Answers.LastActivityDate: 2015-04-09T10:04:57.300Z
Answers.UserDisplayName: carlcs
Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-09T10:03:15.037Z
Comments.Text: Never mind, n00b moment - figured it out.
Comments.UserDisplayName: toffeejay
Tags: <assets>
Title: Create assets subfolder on upload based on entry field value?
ThreadText: # 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](http://buildwithcraft.com/docs/assets-fields#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' }}
  
  ```
  
  
  ---
  
  