code in javascript for image drag and drop and upload
<p>From the code below  how to get the <code>filename</code> in a variable and then display it.
Can I extract the file name from <code>{%=file.name%}</code></p>

<pre><code>&lt;script id="template-download" type="text/x-tmpl"&gt;

{% for (var i=0, file; file=o.files[i]; i++) { %}

    &lt;tr class="template-download fade"&gt;
        {% if (file.error) { %}
            &lt;td&gt;&lt;/td&gt;
            &lt;td class="name"&gt;&lt;span&gt;{%=file.name%}&lt;/span&gt;&lt;/td&gt;
            &lt;td class="size"&gt;&lt;span&gt;{%=o.formatFileSize(file.size)%}&lt;/span&gt;&lt;/td&gt;
            &lt;td class="error" colspan="2"&gt;&lt;span class="label label-important"&gt;Error&lt;/span&gt; {%=file.error%}&lt;/td&gt;
        {% } else { %}
            &lt;td class="preview"&gt;{% if (file.thumbnail_url) { %}
                &lt;a href="{%=file.url%}" title="{%=file.name%}" data-gallery="gallery" download="{%=file.name%}"&gt;&lt;img src="{%=file.thumbnail_url%}"&gt;&lt;/a&gt;

            {% } %}&lt;/td&gt;
            &lt;td class="name"&gt;
                &lt;a href="{%=file.url%}" title="{%=file.name%}" data-gallery="{%=file.thumbnail_url&amp;&amp;'gallery'%}" download="{%=file.name%}"&gt;{%=file.name%}&lt;/a&gt;

            &lt;/td&gt;
            &lt;td class="size"&gt;&lt;span&gt;{%=o.formatFileSize(file.size)%}&lt;/span&gt;&lt;/td&gt;
            &lt;td colspan="2"&gt;&lt;/td&gt;
        {% } %}
        &lt;td class="delete"&gt;
            &lt;button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}"{% if (file.delete_with_credentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}&gt;
                &lt;i class="icon-trash icon-white"&gt;&lt;/i&gt;
                &lt;span&gt;Delete&lt;/span&gt;
            &lt;/button&gt;
            &lt;input type="checkbox" name="delete" value="1"&gt;
        &lt;/td&gt;
    &lt;/tr&gt;

  {% } %}

&lt;/script&gt;
</code></pre>
