【问题标题】:grails - upload file in gsp (disappear after clicking cancel)grails - 在 gsp 中上传文件(点击取消后消失)
【发布时间】:2017-08-17 08:37:16
【问题描述】:

我必须在我的项目中上传一个文件。但是当我取消对话框时,之前上传的文件正在消失。即使在我取消对话框后,有没有办法维护第一个选择的文件。

这是我的代码

<div class="input-field" id="uploadAuditReport">
    <label class="active">Upload Audit Report *</label>
    <input type="file" id="reportFileData" name="reportFileData" required-error="Please upload a file" class="m-b-10 card-panel" style="bottom-border: dotted 1px" pattern="^.*(xls|xlsx|doc|pdf|docx|ods|jpg|jpeg|png|XLS|XLSX|DOC|PDF|DOCX|ODS|JPG|JPEG|PNG)$" pattern-error="File must be in xls, xlsx, doc, pdf, docx, ods, jpg/ jpeg, and png format" required="" filesize="30000000" filesize-error="File must not exceed a file size of 30 MB." >                                      
</div>

【问题讨论】:

    标签: grails gsp


    【解决方案1】:

    很遗憾,这是不可能的。见:input type="file", clearing file after clicking cancel in chrome

    • 您无法检测到何时单击取消
    • 你无能为力
    • 不同的浏览器以不同的方式处理它

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-21
      • 2019-01-29
      相关资源
      最近更新 更多