3

blueimp jQuery-File-Upload pluginを使用するプロジェクトに取り組んでい ます。

サーバー側で発生したエラーは表示されるだけなので表示できません Empty file upload result

アップロードされたファイルを表示するための jQuery テンプレートです。

<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-download fade">
        {% if (file.error) { %}
            <td></td>
            <td class="name"><span>{%=file.name%}</span></td>
            <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
            <td class="error" colspan="2">
              <span class="label label-important">
                {%=locale.fileupload.error%}
              </span>
              {%=locale.fileupload.errors[file.error] || file.error%}
            </td>
        {% } else { %}
            <td class="name">
                <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
            </td>
            <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
        {% } %}


    </tr>
{% } %}
</script>

json に直接アクセスする方法や、バックエンドから既に送信したエラー メッセージを取得するその他の方法を知りたいです。

前もって感謝します

4

1 に答える 1