3

I am using Krajee Bootstrap File Input. The Problem is that in my Edit Page I want to display the initialPreview of a PDF file from a record, but when I submit the form for update, the file input sends null value.

Here's my code:

Form --

<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},
  ],
 });

Thanks in advance!!

BJ Langruto
  • 77
  • 2
  • 7

1 Answers1

-1

Check the docs for refresh method. For that you need to call destroy method and then reinitialize plugin with complete fresh options.

msn.secret
  • 419
  • 5
  • 11