Answers.Body: <p><code>image.filename</code> should work unless I'm missing something. Note that it is case-sensitive.</p>
  
  <p>The documentation on <code>AssetFileModel</code> can be found here:
  <a href="http://buildwithcraft.com/docs/templating/assetfilemodel" rel="noreferrer">http://buildwithcraft.com/docs/templating/assetfilemodel</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-23T18:57:49.787Z
Answers.Text: Of course the one variation I did not try was all lowercase. Sigh. That worked. Thanks for answering!
Answers.UserDisplayName: user2056505
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-23T18:58:40.860Z
Answers.Text: It's always that way for me. Sometimes it just takes another set of eyes. Happy to help!
Answers.UserDisplayName: Peter Tell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-23T18:55:01.543Z
Answers.LastActivityDate: 2015-04-23T18:56:15.237Z
Answers.LastEditDate: 2015-04-23T18:56:15.237Z
Answers.UserDisplayName: Peter Tell
Body: <p>I'm trying to get the actual file name of each images when looping through the image assets folder, which looks like:</p>
  
  <pre><code>{% for image in craft.assets.kind('image').folderId('1').order('filename') %}
      &lt;li&gt;&lt;a href="#"&gt;&lt;img src="{{ image.getUrl() }}" alt="{{ image.title }}"&gt;&lt;/a&gt;&lt;/li&gt;
  {% endfor %}
  </code></pre>
  
  <p>I need to be able to include the filename of the image as a data attribute in the <code>&lt;a&gt;</code> tag. I tried all sorts of variations of {{ image.fileName }} but have had no luck. Can't find a solution searching here. Does anyone know how? Better yet - is there a documentation somewhere showing all the available twig attributes for assets/images?</p>
  
Tags: <templating><assets>
Title: Get Asset Image File Name
ThreadText: # Get Asset Image File Name
  
  (Asked by: username_0 on 2015-04-23)
  
  I'm trying to get the actual file name of each images when looping through the image assets folder, which looks like:
  
  ```
  {% for image in craft.assets.kind('image').folderId('1').order('filename') %}
      <li><a href="#"><img src="{{ image.getUrl() }}" alt="{{ image.title }}"></a></li>
  {% endfor %}
  
  ```
  
  I need to be able to include the filename of the image as a data attribute in the `<a>` tag. I tried all sorts of variations of {{ image.fileName }} but have had no luck. Can't find a solution searching here. Does anyone know how? Better yet - is there a documentation somewhere showing all the available twig attributes for assets/images?
  
  **Tags:** templating, assets
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-04-23. Score: 8 | Accepted answer
  
  `image.filename` should work unless I'm missing something. Note that it is case-sensitive.
  
  The documentation on `AssetFileModel` can be found here:
  <http://buildwithcraft.com/docs/templating/assetfilemodel>
  
  > **Comments:**
  > **username_0**: Of course the one variation I did not try was all lowercase. Sigh. That worked. Thanks for answering!  
  > **username_1**: It's always that way for me. Sometimes it just takes another set of eyes. Happy to help!  
  
  ---
  
  