<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>

CC BY-SA 3.0
2014-08-09T10:59:41.847Z
2014-08-09T10:59:41.847Z
Daryl Campbell
<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>

CC BY-SA 3.0
2014-08-08T21:34:45.733Z
Pretty sure you're running into this? http://craftcms.stackexchange.com/a/1574/57
Brad Bell
CC BY-SA 3.0
2014-08-08T21:43:49.620Z
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.
Daryl Campbell
CC BY-SA 3.0
2014-08-08T21:54:08.797Z
I think I understand now. You have to select "Restrict uploads to a single folder" instead of having a Default Upload Location?
Daryl Campbell
CC BY-SA 3.0
2014-08-08T21:56:16.067Z
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.
Brad Bell
CC BY-SA 3.0
2014-08-08T22:11:06.310Z
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.
Daryl Campbell
CC BY-SA 3.0
2014-08-08T22:12:47.490Z
Ahh, probably worth adding that as the official answer then, in case someone else runs into it.
Brad Bell
CC BY-SA 3.0
2014-08-08T22:38:26.230Z
Thanks, will do. I'm a new user though so says I can't answer for 8 hours.
Daryl Campbell
CC BY-SA 3.0
2014-08-08T22:42:35.637Z
Silly Stack Exchange.
Brad Bell
<assets><slug>
Using { slug } to create subfolders won't work
# 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 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.  
> **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.


---

