<p>Problem solved thanks to Craft Twitter support; needed to re-build the Asset Indexes; because I'd added that field after already creating an entry the asset index was stale and needed flushing.</p>

<ol>
<li>Open Craft admin dashboard</li>
<li>Click <em>Settings</em></li>
<li>Click <em>Update Asset Indexes</em></li>
<li>Click <em>Go!</em></li>
</ol>

<p>This process scans through the list of assets in the database and ensures it matches what is in the file system and updates the database as needed.</p>

CC BY-SA 3.0
2014-12-04T11:07:05.830Z
2017-08-04T18:39:52.660Z
2017-08-04T18:39:52.660Z
Matt Wilcox
<p>I have a field 'Event Listing Image' set up as: </p>

<ul>
<li>Field Type: Asset</li>
<li>Restrict uploads to single folder</li>
<li>Upload location [Events]{slug}</li>
</ul>

<p>There's an asset bucket Events:</p>

<ul>
<li>Local Folder</li>
<li>File System Path: {fileSystemPath}/content/events/</li>
<li>URL: /content/events/</li>
</ul>

<p>The field is in a section named Events of type Channel.</p>

<p>The system folder /content/events/ exists and is writable.</p>

<p>If I edit an existing Entry in that channel, I can click upload in that field, but it errors every time with:</p>

<blockquote>
  <p>Upload failed for test.jpg. The error message was: ”Error uploading the file: The folder “/Users/matt/Sites/bs_conwyarts/_bespoke/public/content/events/test-event/” does not exist.“</p>
</blockquote>

<p>I know it doesn't, it's dynamic based on the entry slug. Why is Craft not creating the folder?</p>

<p>Irony: I have a field called Featured Image set up almost identically on a different Channel that does work:</p>

<p>Featured Image:</p>

<ul>
<li>Field Type: Asset</li>
<li>Restrict uploads to single folder</li>
<li>Upload location [Artists]{slug}</li>
</ul>

<p>Asset bucket Artists:</p>

<ul>
<li>Local folder</li>
<li>File System Path: {fileSystemPath}/content/artists/</li>
<li>URL: /content/artists</li>
</ul>

<p>UPDATE: looks like a bug. It works fine for new entries posted in the Events channel, it does not work for the existing entry in the Channel. I think I added the field in question <em>after</em> creating the first entry, so it looks like that might be the culprit.</p>

<assets>
Why aren't dynamic folders being generated for assets?
# Why aren't dynamic folders being generated for assets?

(Asked by: username_0 on 2014-12-04)

I have a field 'Event Listing Image' set up as:

* Field Type: Asset
* Restrict uploads to single folder
* Upload location [Events]{slug}

There's an asset bucket Events:

* Local Folder
* File System Path: {fileSystemPath}/content/events/
* URL: /content/events/

The field is in a section named Events of type Channel.

The system folder /content/events/ exists and is writable.

If I edit an existing Entry in that channel, I can click upload in that field, but it errors every time with:

> Upload failed for test.jpg. The error message was: ”Error uploading the file: The folder “/Users/matt/Sites/bs\_conwyarts/\_bespoke/public/content/events/test-event/” does not exist.“

I know it doesn't, it's dynamic based on the entry slug. Why is Craft not creating the folder?

Irony: I have a field called Featured Image set up almost identically on a different Channel that does work:

Featured Image:

* Field Type: Asset
* Restrict uploads to single folder
* Upload location [Artists]{slug}

Asset bucket Artists:

* Local folder
* File System Path: {fileSystemPath}/content/artists/
* URL: /content/artists

UPDATE: looks like a bug. It works fine for new entries posted in the Events channel, it does not work for the existing entry in the Channel. I think I added the field in question *after* creating the first entry, so it looks like that might be the culprit.

**Tags:** assets

---

## 1 answers

### Answer by username_0 on 2014-12-04. Score: 2 | Accepted answer

Problem solved thanks to Craft Twitter support; needed to re-build the Asset Indexes; because I'd added that field after already creating an entry the asset index was stale and needed flushing.

1. Open Craft admin dashboard
2. Click *Settings*
3. Click *Update Asset Indexes*
4. Click *Go!*

This process scans through the list of assets in the database and ensures it matches what is in the file system and updates the database as needed.


---

