Answers.Body: <p>Got the problem solved, I had wanted to have the option of selecting photos from another folder so in the field settings I had Default Upload Location with the {slug} in there. When I switched it to "restrict to single folder" and set the {slug} then it is all functioning as expected. I don't think it would make sense selecting a photo from another folder in this field as the asset wouldn't be able to move when entry is saved. Hope this makes sense. I just have the same issue as the other post now where I don't see the caption field until the entry is saved. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-09T10:59:41.847Z
Answers.LastActivityDate: 2014-08-09T10:59:41.847Z
Answers.UserDisplayName: Daryl Campbell
Body: <p>I'm running craft locally using MAMP and I'm trying to move assets into a subfolder when unploaded into an image field in my gallery section. </p>
  
  <p>I'm trying to set the path to subfolder so it uses the slug. When I put {slug} into the field settings nothing happens when I upload the images and save the entry, it just pulls them all into the top level folder.</p>
  
  <p>Im not sure if its something in the local file permissions or something but I can bring the images in fine and transforms work okay ie. they create folders and pop the images in fine.</p>
  
  <p>Any help would be appreciated</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-08T21:34:45.733Z
Comments.Text: Pretty sure you're running into this? http://craftcms.stackexchange.com/a/1574/57
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-08T21:43:49.620Z
Comments.Text: Thanks for the quick response. Does this mean its not possible to dynamically generate the folders when uploading an image into the gallery. I may be misunderstanding the issue though. I can't see a way to set the upload location on assigning the field to an entry type.
Comments.UserDisplayName: Daryl Campbell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-08T21:54:08.797Z
Comments.Text: I think I understand now. You have to select "Restrict uploads to a single folder" instead of having a Default Upload Location?
Comments.UserDisplayName: Daryl Campbell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-08T21:56:16.067Z
Comments.Text: Maybe *I'm* misunderstanding, but it looks like you're trying to use the entry's {slug} in the asset upload URI, but the entry doesn't have a {slug} until the first time it has been saved. A bit of a catch-22.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-08T22:11:06.310Z
Comments.Text: Thanks Brad, it was just me being really stupid :) I had wanted to have the option of selecting photos from another folder so in the field settings I had Default Upload Location with the {slug} in there. When I switched it to "restrict to single folder" and set the {slug} then it is all functioning as expected. I don't think it would make sense selecting a photo from another folder in this field as the asset wouldn't be able to move when entry is saved. Hope this makes sense. I just have the same issue as the other post now where I don't see the caption field until the entry is saved.
Comments.UserDisplayName: Daryl Campbell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-08T22:12:47.490Z
Comments.Text: Ahh, probably worth adding that as the official answer then, in case someone else runs into it.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-08T22:38:26.230Z
Comments.Text: Thanks, will do. I'm a new user though so says I can't answer for 8 hours.
Comments.UserDisplayName: Daryl Campbell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-08-08T22:42:35.637Z
Comments.Text: Silly Stack Exchange.
Comments.UserDisplayName: Brad Bell
Tags: <assets><slug>
Title: Using { slug } to create subfolders won't work
ThreadText: # Using { slug } to create subfolders won't work
  
  (Asked by: username_0 on 2014-08-08)
  
  I'm running craft locally using MAMP and I'm trying to move assets into a subfolder when unploaded into an image field in my gallery section.
  
  I'm trying to set the path to subfolder so it uses the slug. When I put {slug} into the field settings nothing happens when I upload the images and save the entry, it just pulls them all into the top level folder.
  
  Im not sure if its something in the local file permissions or something but I can bring the images in fine and transforms work okay ie. they create folders and pop the images in fine.
  
  Any help would be appreciated
  
  **Tags:** assets, slug
  
  > **Comments:**
  > **username_1**: Pretty sure you're running into this? http://craftcms.stackexchange.com/a/1574/57  
  > **username_0**: Thanks for the quick response. Does this mean its not possible to dynamically generate the folders when uploading an image into the gallery. I may be misunderstanding the issue though. I can't see a way to set the upload location on assigning the field to an entry type.  
  > **username_0**: I think I understand now. You have to select "Restrict uploads to a single folder" instead of having a Default Upload Location?  
  > **username_1**: Maybe *I'm* misunderstanding, but it looks like you're trying to use the entry's {slug} in the asset upload URI, but the entry doesn't have a {slug} until the first time it has been saved. A bit of a catch-22.  
  > **username_0**: Thanks username_1, it was just me being really stupid :) I had wanted to have the option of selecting photos from another folder so in the field settings I had Default Upload Location with the {slug} in there. When I switched it to "restrict to single folder" and set the {slug} then it is all functioning as expected. I don't think it would make sense selecting a photo from another folder in this field as the asset wouldn't be able to move when entry is saved. Hope this makes sense. I just have the same issue as the other post now where I don't see the caption field until the entry is saved.  
  > **username_1**: Ahh, probably worth adding that as the official answer then, in case someone else runs into it.  
  > **username_0**: Thanks, will do. I'm a new user though so says I can't answer for 8 hours.  
  > **username_1**: Silly Stack Exchange.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2014-08-09. Score: 2
  
  Got the problem solved, I had wanted to have the option of selecting photos from another folder so in the field settings I had Default Upload Location with the {slug} in there. When I switched it to "restrict to single folder" and set the {slug} then it is all functioning as expected. I don't think it would make sense selecting a photo from another folder in this field as the asset wouldn't be able to move when entry is saved. Hope this makes sense. I just have the same issue as the other post now where I don't see the caption field until the entry is saved.
  
  
  ---
  
  