2016-08-16 134 views
0

我試圖顯示在index.html中上傳的文件的最後修改日期。顯示文件最後一次修改日期在Blueimp

我已經試過如下:

<td> 
    <span class="date">{%=file.lastModifiedDate%}</span> 
</td> 

這個工程上線154,它可用於上傳文件的一部分罰款:元素。

但是,當我在第198行添加上面的代碼時,它不起作用,它是可用於下載元素的文件的一部分。

的代碼是index.html的 - >https://github.com/blueimp/jQuery-File-Upload/blob/master/index.html

誰能幫助請。 謝謝。

回答

0

從第146行到第174行有一個for循環,它從files數組得到file對象,但這些是上傳的文件。您正在獲得的行是可供下載的文件。這就是爲什麼你無法獲得日期的原因,因爲沒有可供下載的文件。

<!-- The template to display files available for upload --> 
<script id="template-upload" type="text/x-tmpl"> 
{% for (var i=0, file; file=o.files[i]; i++) { %} 
      <tr class="template-upload fade"> 
       <td> 
        <span class="preview"></span> 
       </td> 
       <td> 
        <p class="name">{%=file.name%}</p> 
        <strong class="error text-danger"></strong> 
       </td> 
       <td> 
        <p class="size">Processing...</p> 
        <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div> 
       </td> 
       <td> 
        {% if (!i && !o.options.autoUpload) { %} 
         <button class="btn btn-primary start" disabled> 
          <i class="glyphicon glyphicon-upload"></i> 
          <span>Start</span> 
         </button> 
        {% } %} 
        {% if (!i) { %} 
         <button class="btn btn-warning cancel"> 
          <i class="glyphicon glyphicon-ban-circle"></i> 
          <span>Cancel</span> 
         </button> 
        {% } %} 
       </td> 
      </tr> 
     {% } %} 
+0

所以...我如何得到它顯示最後一個mod。可供下載的文件日期? – srsk