gpt4 book ai didi

bootstrap-file-input - 初始预览中的 Bootstrap FileInput 填充输入值

转载 作者:行者123 更新时间:2023-12-05 08:08:10 25 4
gpt4 key购买 nike

我正在使用 Krajee Bootstrap 文件输入。问题是,在我的编辑页面中,我想显示来自记录的 PDF 文件的 initialPreview,但是当我提交表单进行更新时,文件输入发送空值。

这是我的代码:

表格--

<div class="form-group col-md-4">
<label for="pdf_file">Document</label>
<div class="file-loading">
<input class="file" name="pdf_file" id="pdf_file" value="" type="file">
</div>
</div>

JS——

$("#pdf_file").fileinput({
theme: "fa",
allowedFileExtensions: ["pdf"],
maxFileCount: 1,
showUpload: false,
showCaption: false,
overwriteInitial: true,
fileType: "pdf",
browseClass: "btn btn-primary btn-md",
initialPreview: [
"http://localhost/local_storage/aPxU3p71hpLjaI3lbTXrjRuigUxU94pq.pdf",
],
initialPreviewAsData: true,
initialPreviewConfig: [
{type: "pdf", size: "100%", width: "100%", key: 1},
],
});

提前致谢!!

最佳答案

查看 refresh method 的文档.为此,您需要调用 destroy 方法,然后使用全新的选项重新初始化插件。

关于bootstrap-file-input - 初始预览中的 Bootstrap FileInput 填充输入值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51995964/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com