Closed lj19950508 closed 3 years ago
Which plugin version are you using?
bootstrap-fileinput-5.2.2
Not sure why - because it works fine on tests - You can cross check this with ajax demo example #4.
Check your app code and client browser has stale cache loading outdated assets. Check if any other javascript errors in your app on your client browser console.
Also test with the latest code on dev-master (v5.2.3 not released yet) and confirm.
when i use batch upload button , it's works when i use simpe upload button , it doesn't work ;
ajax demo example #4. , when i first upload with simple upload button , and it errors, but when i use batchupload button , it's ok
@kartik-v If I don't define type by response, can I automatically adapt the preview file type according to the file suffix eg. .jpg ->image .pdf ->pdf .txt-> text because if i upload txtfile and return a pdffile without type , it will preview as image
Yes the above behavior already exists in the plugin and you can override the default configurations via fileTypeSettings
@kartik-v when i upload and response initialPreviewConfig without type fileTypeSettings doesn't work ,
i must be set attr type
this is response
prev comments add result image
Yes for initialPreview
you must set the type
in initialPreviewConfig
for each file from server to display the right template.... else default will be image
Prerequisites
master
branch of bootstrap-fileinput.Steps to reproduce the issue
1.upload with ajax , and response like , and it can be preview by image type.
Expected behavior and actual behavior
when not uploaded, every work , but when uploaded and use response option, i can't preview with modal detail
Environment
Browsers
Operating System
Libraries
jQuery version: 3.5.1
bootstrap-fileinput version: 5.2.2
botstrap 4.4.1
Isolating the problem
[ ] This bug happens on the plugin demos page
[ ] The bug happens consistently across all tested browsers
[✔ ] This bug happens when using bootstrap-fileinput without other plugins
[ ] I can reproduce this bug in a jsbin