我必须在我的项目中上传文件。但是当我取消对话框时,先前上传的文件正在消失。有没有办法在取消对话框后维护第一个选择的文件。
这是我的代码
<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>
答案 0 :(得分:1)
不幸的是,这是不可能的。请参阅:input type="file", clearing file after clicking cancel in chrome