NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #2339 most downloaded on Packagist
An enhanced HTML 5 file input for Bootstrap 5.x, 4.x, and 3.x with features for file preview for many file types, multiple selection, ajax uploads, and more.
Latest stable
v5.5.4
Last release 3 years ago
no release in 18 months
Ships unpredictably
gaps range from 2 weeks to 1.4 years
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
92 releases · first in 2014
Drag across the ruler to compare, or tap a release to open it.
(bug #1858): Correct Plugin Options & Themes Initialization.
Date: 09-Apr-2024
(enh #1856): Replace and fix deprecated jQuery methods.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Date: 11-Mar-2024
maxMultipleFileSize feature check.autocomplete for button.(bug #1822): Correct file type tokenizer parsing.
Date: 13-Oct-2022
(enh #1809, #1810): Correct minified plugins file "filetype.min.js".
Date: 17-Aug-2022
(enh #1800): Styling enhancements for thumbnail content and rotatable images.
Major Release: BC Breaking
Date: 29-Jun-2022
{maxSize}, {minSize}, {size}.fa6explorer-fa6fa theme to fa4fas theme to fa5explorer-fa theme to explorer-fa4explorer-fas theme to explorer-fa5<!-- buffer.min.js and filetype.min.js are necessary in the order listed for advanced mime type parsing and more correct
preview. This is a feature available since v5.5.0 and is needed if you want to ensure file mime type is parsed
correctly even if the local file's extension is named incorrectly. This will ensure more correct preview of the
selected file (note: this will involve a small processing overhead in scanning of file contents locally). -->
<script src="https://cdn.jsdelivr.net/gh/kartik-v/bootstrap-fileinput@5.5.0/js/plugins/buffer.min.js" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/gh/kartik-v/bootstrap-fileinput@5.5.0/js/plugins/filetype.min.js" type="text/javascript"></script>
(enh #1791): Enhance preview update automatically when addToStack is called.
(enh #1785): Image rotation button action feature in thumbnail and zoom.
rotatableFileExtensions defaults to ['jpg', 'jpeg', 'png', 'gif'],fileActionSettings (rotateIcon, rotateTitle, rotateClass)previewZoomButtonIcons.rotate, previewZoomButtonClasses.rotate and previewZoomButtonTitles.rotate(enh #1788): Enhancements to showUserError method.
retainErrorHistory which allows you to retain previous errors (defaults to false)var $input = $('#file-input-id');
$input.on('fileuploaderror', function(event, data) {
var userMessage = 'We could not process the upload because of a server error.',
retainErrorHistory = true; // whether to retain error history
// to show error specific to each file pass `data` as received above (the `data` object must contain the `fileId` property)
$input.fileinput('showUserError', userMessage, data, retainErrorHistory);
// to show a constant global error not specific to each file do not pass `data` (uncomment below line to achieve this)
// $input.fileinput('showUserError', userMessage);
});
alwaysPreviewFileExtensions - setup as an array list of extensions whose content will always be shown in preview (irrespective of preferIconPreview or previewFileIconSettings which will be used to control icon preview for configured types).Major Release: BC Breaking
Date: 29-Jun-2022
{maxSize}, {minSize}, {size}.fa6explorer-fa6fa theme to fa4fas theme to fa5explorer-fa theme to explorer-fa4explorer-fas theme to explorer-fa5<!-- buffer.min.js and filetype.min.js are necessary in the order listed for advanced mime type parsing and more correct
preview. This is a feature available since v5.5.0 and is needed if you want to ensure file mime type is parsed
correctly even if the local file's extension is named incorrectly. This will ensure more correct preview of the
selected file (note: this will involve a small processing overhead in scanning of file contents locally). -->
<script src="https://cdn.jsdelivr.net/gh/kartik-v/bootstrap-fileinput@5.5.0/js/plugins/buffer.min.js" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/gh/kartik-v/bootstrap-fileinput@5.5.0/js/plugins/filetype.min.js" type="text/javascript"></script>(enh #1791): Enhance preview update automatically when addToStack is called.
(enh #1785): Image rotation button action feature in thumbnail and zoom.
rotatableFileExtensions defaults to ['jpg', 'jpeg', 'png', 'gif'],fileActionSettings (rotateIcon, rotateTitle, rotateClass)previewZoomButtonIcons.rotate, previewZoomButtonClasses.rotate and previewZoomButtonTitles.rotate(enh #1788): Enhancements to showUserError method.
retainErrorHistory which allows you to retain previous errors (defaults to false)var $input = $('#file-input-id');
$input.on('fileuploaderror', function(event, data) {
var userMessage = 'We could not process the upload because of a server error.',
retainErrorHistory = true; // whether to retain error history
// to show error specific to each file pass `data` as received above (the `data` object must contain the `fileId` property)
$input.fileinput('showUserError', userMessage, data, retainErrorHistory);
// to show a constant global error not specific to each file do not pass `data` (uncomment below line to achieve this)
// $input.fileinput('showUserError', userMessage);
});alwaysPreviewFileExtensions - setup as an array list of extensions whose content will always be shown in preview (irrespective of preferIconPreview or previewFileIconSettings which will be used to control icon preview for configured types).(enh #1787): Enhance image size validation messages.
Date: 10-May-2022
layoutTemplates.fileIcon.autoReplace behavior to clear already uploaded thumbnails.showUserError and new event fileusererror.
Usage:var $input = $('#file-input-id');
$input.on('fileuploaderror', function(event, data) {
var userMessage = 'We could not process the upload because of a server error.';
// to show error specific to each file pass `data` as received above (the `data` object must contain the `fileId` property)
$input.fileinput('showUserError', userMessage, data);
// to show a constant global error not specific to each file do not pass `data` (uncomment below line to achieve this)
// $input.fileinput('showUserError', userMessage);
});
alt property for image is applied via intial preview config if set.maxFilePreviewSize.msgSizeTooLarge.(enh #1767): Enhance ajax task queuing to validate maxAjaxThreads correctly.
Date: 17-Dec-2021
maxAjaxThreads correctly.
filebatchuploadsuccess and filebatchuploaderror)gly theme.(bug #1758): Correct bootstrap module parser.
Date: 23-Sep-2021
getLoadingUrl to a new $h.getZoomPlaceholder method.(enh #1755): Simplify NPM module handling.
Date: 19-Sep-2021
(enh #1754): Default button styling & Explorer theme enhancements.
Date: 17-Sep-2021
(enh #1738): Enhancements to zoomed preview to include additional description and better title styling.
Date: 25-Jul-2021
initialPreviewConfig will include an additional property descriptionkv-zoom-description container which will render the description from initialPreviewConfig. This container will be hidden if no description found.kv-zoom-caption container which will render the caption or filename from initialPreviewConfig. If that is not found it will default to msgZoomModalHeading.kv-zoom-size container which will render the size as set in initialPreviewConfig.showDescriptionClose (boolean). Will show a close icon to close the description bubble text when set to true. Defaults to true.sizeUnits defaults to ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']bitRateUnits defaults to ['B/s', 'KB/s', 'MB/s', 'GB/s', 'TB/s', 'PB/s', 'EB/s', 'ZB/s', 'YB/s']bytesToKB which defaults to 1024 is used for conversion.inputGroupClass - defaults to empty stringinput-group-lg or input-group-sm to get bootstrap input group stylesfileselect event triggering.zoomData to lazy load content asynchronously only on zoom.filebatchpreupload event listening for effective aborting.This is a BC breaking change - which will remove GLYPHICONS as default icons and replace them with Bootstrap 5.x Icon Library. Users must load the Boo…
Date: 19-Jun-2021
layoutTemplates.main2 to use wrapper container for the buttons to use mainClassbs5 to support bootstrap 5.x icons and styles(enh #1705): Enhance reset of file caption title.
Date: 19-May-2021
(enh #1674): Enhancements to add support for Bootstrap v5.
Date: 06-May-2021
$.fn.fileinputBsVersiontabIndexConfig for configuration of tab indices for each section
which defaults to (null value means no tabindex property will be set for that section) tabIndexConfig: {
caption: 500,
browse: 500,
remove: 500,
upload: 500,
cancel: null,
pause: null,
modal: -1
}
(enh #1687, #1688): Allow error history to be displayed for resumable uploads.
Date: 03-Mar-2021
resumableUploadOptions.retainErrorHistoryresumableUploadOptions.skipErrorsAndProceedfilemaxretries(enh #1672): Add namespace control on bootstrap modal show trigger to avoid interaction with other plugins.
Date: 12-Jan-2021
_getThumbFileId.showPreview is false.fileuploaded event for non-resumable ajax async uploads.getFilesSize to return sum of bytes of all files.(enh #1644): Fix problem with outlook deleting email after drag and drop.
Date: 24-Oct-2020
aria-labelledby binding.preProcessUpload callback that can convert / encrypt file content before upload.minFileSize to -1 to allow zero byte files to be uploaded.(enh #1604): Correct upload stats time calculation for sync uploads.
Date: 15-Jul-2020
removeThumb validation for in readFiles throwError method.(enh #1587): Enhance resumable ajax error trapping.
Date: 20-Jun-2020
(enh #1584): Revamp Krajee Explorer Themes.
Date: 11-Jun-2020
showConsoleLogs to false as default.… instead of three dots.(enh #1574): Enhance filezoom events to fire correctly only once for the source file input.
Date: 02-Jun-2020
_parseError function.filebeforeload event abort when returning false.filebatchselected trigger for single file uploads.required property.(enh #1514): Enhancements to duplicate file selection.
Date: 13-Dec-2019
fileduplicateerror will be triggered after every duplicate file detected.close icon.fadeDelay used in fade out / fade in animations of error containers.filebeforeload event (only for ajax uploads). Can be used to abort loading of specific files at runtime.
Usage: $('#input').on('filebeforeload', function(event, file, index, reader) {
// perform your validations based on the 'file' or other parameters
if (file.name === 'UNAPPROVED_FILE.txt') {
return false; // will abort the file loading for the selected file
}
});
getFilesCount method.showZoom.showPreview is false.initialPreviewShowDelete setting correctly.(enh #1496): Correct isEmpty check for functions.
Date: 17-Nov-2019
addToStack method.updateStack methodclearStack to clearFileStack methodshowPreview is false.maxFileCount and msgFilesTooMany for files being selected before uploadmaxTotalFileCount and msgTotalFilesTooMany for total files selected and files included in initial previewfocusCaptionOnBrowse and focusCaptionOnClear which default to true.(enh #1464): Correct preview frame float styling issues.
Date: 11-Sep-2019
filebatchselected event trigger.removeFromPreviewOnError validation.other when invalid file type is passed.(enh #1450): Update Russian Translations.
Date: 23-Aug-2019
showConsoleLogs to control display of plugin console messages..npmignore to clean unwanted files for NPM package.(enh #1422): Correct drag indicator SCSS.
Date: 30-Jun-2019
preferIconicPreview parsing.getFileStack and getFileList methods.(enh #1409): Correct the sequence of raise of filechunksuccess event.
Date: 12-May-2019
filechunksuccess event.enableResumableUpload is true):
indicatorPausedindicatorPausedTitleresume method and enhance pause method for resumable uploadsuploadParamNames to include all parameters.(enh #1394): New error message properties (updates to locales).
Date: 18-Apr-2019
msgProgressErrormsgDeleteErrormsgUploadError (modification)retryErrorUploads setting.showPreview is false.fileActionSettings.(enh #1382): Better defaults for resumableUploadOptions.chunkSize and progressDelay.
Date: 26-Mar-2019
resumableUploadOptions.chunkSize and progressDelay.
progressDelay to 0 and resumableUploadOptions.chunkSize to 2048 KB i.e. (2 MB)uploadExtraData to be submitted correctly with ajax responses.sanitizeZoomCache which is a function callback and defaults to:function(content) {
var $container = $(document.createElement('div')).append(content);
$container.find('input,select,.file-thumbnail-footer').remove();
return $container.html();
}
uploadUrl, deleteUrl, resumableUploadOptions.testUrl.
These can now be also setup as a function callback that will be executed at runtime.(enh #1378): Allow throttling / delaying xhr progress updates.
Date: 24-Mar-2019
uploadProgressDelay in microseconds - will default to 100 - this will control how frequent the xhr upload progress will be checked. If set to null or 0 - will do it every microsecond.maxAjaxThreads (will default to 5) that will allow to spawn only this limit of ajax requests in parallel.resumableUploadOptions['maxThreads'] (defaults to 4) which is applicable for spawning number of ajax chunk requests for resumable uploads. The resumableUploadOptions['maxThreads'] property must be less than or equal to maxThreads - else it will be over-ridden by maxThreads global setting.layoutTemplates['stats'] for displaying statslayoutTemplates.stats = '<div class="text-info file-upload-stats">' +
'<span class="pending-time">{pendingTime}</span> ' +
'<span class="upload-speed">{uploadSpeed}</span>' +
'</div>';
{stats} will be replaced with abovelayoutTemplates['progress']initialPreviewConfig sent from the server can contain the exif property as an object.autoOrientImageInitial is a new boolean property that controls whether images need to be auto-oriented based on exif orientation.allowedPreviewTypes (existing)
- allowedPreviewMimeTypes (existing)
- allowedPreviewExtensions (new)
- disabledPreviewTypes (new)
- disabledPreviewExtensions (new) - defaults to ['msi', 'exe', 'com', 'zip', 'rar', 'app', 'vb', 'scr']
- disabledPreviewMimeTypes (new) - defaults to ['application/octet-stream']fileManager and resumableManager internal objects.filestack property has been removedaddToFileStack and updateFileStack methods have been removedshowXXX properties in fileActionSettings ca3n now be setup as a callback.initialPreviewConfig for initial preview thumbnailsenableResumableUpload and resumableUploadOptions(enh #1371): Capture file identifier in thumbnails
Date: 21-Mar-2019
alt and title attributes for images in initialPreviewConfig.(enh #1342): Update Turkish Translations.
Date: 03-Jan-2019
createObjectURL and revokeObjectURL.mimeTypeAliases.
.mov files to be previewed in non Apple browsers like Chrome/Firefox/IE.encodeUrl boolean option that encodes all URL passed by default.(enh #1305): Correct browseOnZoneClick behavior.
Date: 25-Sep-2018
browseOnZoneClick behavior.(enh #1292): Update DOMPurify plugin to the latest release.
Date: 30-Aug-2018
htmlEncode to parse undefined variables.autoOrientImage to false.filebrowse event to be prevented.usePdfRenderer callback check to detect android phones.(bug #1276): More correct validation of previewContentTemplates.
Date: 25-Jul-2018
previewContentTemplates.showBrowse is false.(enh #1221): Update Indonesian Translations.
Date: 11-Apr-2018
explorer-fas).elErrorContainer validation for browseOnZoneClick.reversePreviewOrder to allow reversing files displayed in preview.showRemove validation in fileActionSettings.Update copyright year to current.
Date: 22-Jan-2018
readFiles to allow input & preview of file objects programmatically.(enh #1125): Create CODE_OF_CONDUCT.md.
Date: 13-Nov-2017
ajaxAborted status more correctly before upload.button markup.cs.piexif errors).Update readme and example index to use plugin's CDN libraries.
Date: 01-Oct-2017
_This release adds Bootstrap v4.x support._
Date: 21-Sep-2017
This release adds Bootstrap v4.x support.
showPreview is false.initialPreviewConfig supplied.previewCache splices deleted initial preview content items).refresh method to overwrite options.{key} & {filename} tags.removeFromPreviewOnError validation.(enh #1059): Better form reset behavior and update of reset method in docs.
Date: 27-Aug-2017
reset method in docs.uploadUrlThumb.retryErrorUploads: boolean, will determine if errored out thumbnails can be retried for upload and submitted again.fileActionSettings.uploadRetryIcon: Will change the icon of the upload button to retry icon specified here.fileActionSettings.uploadRetryTitle: Will change the title of the upload button to retry title specified here.msgUploadError: will be displayed within the progress bar on the errored out thumbnails.retryErrorUploads is false, then no upload button is shown on the errored out thumbnails.{dataKey}.filebeforedelete and enhance delete abort logic.reset method.(enh #1005): Update Dutch Translations.
Date: 24-Jun-2017
hideThumbnailContent) and display only file name/size.rtl to be set) - includes new fileinput-rtl.css (to be loaded after fileinput.css for RTL styling).(enh #980): Add new method getFrames to get all thumbnail frames as jQuery objects.
Date: 25-May-2017
getFrames to get all thumbnail frames as jQuery objects.getExif to retrieve exif data for a selected jpeg image.piexif plugin.showPreview is false.(enh #966): Add Estonian Translations.
Date: 13-May-2017
required and msgFileRequired properties.setTokens string helper for easier replacement of tokens.sourceMappingUrl in purify.min.js.autoOrientImage).showDelete validation in fileActionSettings.indicator.data-fileindex validation.initialPreviewShowDelete.resizeIfMoreThan to control image resize conditionally.(enh #914): Update Portuguese BR translations.
Date: 02-Apr-2017
allowedFileTypes to accept null values.overwriteInitial validation for async batch uploads returning dynamic initial preview post upload.file-success-remove event handling.msgUploadBegin and msgUploadEnd to display a better progress status. The layoutTemplates.progress will support a new token {status}.fileclear and filepreajax to be aborted via event.preventDefault().body element if available to avoid multiple BS modals conflict.allowedFileTypes.zoom with parameter frameId to allow custom triggering of zoomed preview for each thumbnail frame.(enh #879): Update Russian Translations.
Date: 21-Feb-2017
bootstrap.min.css.(enh #862): Launch a brand new Krajee theme: explorer.
Date: 11-Feb-2017
explorer.layoutTemplates.frameClass setting in initialPreviewConfig is considered.body tag exists).initialPreview generation and sortable behavior for async uploads.allowedPreviewTypes.initialPreview config set (post upload).fileimagesresized event triggering.msgUploadEmpty has been incorporated.uploadSingle action in thumbnails.msgFileTypes to control descriptions/localizations of file types displayed.(enh #809): Various enhancements for preview control and iconic thumbnails.
Date: 17-Dec-2016
preferIconicPreview will try to parse the previewFileIconSettings and previewFileExtSettings to automatically force iconic previews for file thumbnails.preferIconicZoomPreview will try to parse the previewFileIconSettings and previewFileExtSettings to automatically force iconic previews in the zoomed content.initialPreview content as well.minFileSize which validates the minimum file size in KB for upload, else throws
a validation error using msgSizeTooSmall. This defaults to 0.minFileSize is set to null, then above validation is skipped and no minimum file size
check is performed.msgInvalidFileName.false then the next file will be read and current file skipped.(bug #758): Correct file slug name parsing for an invalid file extension.
Date: 20-Sep-2016
fileuploaded event params.(enh #731): New method getFilesCount for returning upl + non-upl files count.
Date: 07-Aug-2016
getFilesCount for returning upl + non-upl files count.progressUploadThreshold to show processing when waiting for server response.previewId to fileuploaded event.ifSet validation.(enh #706): Remove invalid files from filestack correctly for validation errors.
Date: 09-Jul-2016
(enh #674): Organize all themes in a separate themes folder.
Date: 11-Jun-2016
themes folder.showBrowse that allows you to control the display of the browse buttonbrowseOnZoneClick that allows you to select a file:
defaultPreviewContent and that will be clickable to browse filesdropZoneClickTitle that will be appended to the dragZoneTitle for ajax uploads when browseOnZoneClick is true.actionDrag will be available within layoutTemplates to configure your drag indicator markup.other template).js/plugins folder.fileActionSettings:
showDragdragIcondragClassdragTitledragSettingslocales: all translation JS files will be located herethemes: all theme JS files will be located hereplugins: third party JS plugins that will be used to work with bootstrap-fileinputtheme added.upload and removeshowZoom, showDrag, showRemove, showUpload are now added to fileActionSettings to control display of these buttonszoomIcon, zoomClass, zoomTitle are available within fileActionSettings for controlling the zoom button styles and display.dragIcon, dragClass, dragTitle are available within fileActionSettings for controlling the drag indicator styles and display.actionZoom and actionDrag are available within layoutTemplates to configure the markup of the zoom and drag buttons.initialPreview can be setup MORE easier without writing or returning entire markup. Thus the new functionality will enable to use built in previewTemplates.initialPreviewAsData is available to control the above. If set to true, it will allow developers to now pass just the data within initialPreview (instead of complete markup) and the markup will be auto generated using previewTemplates.initialPreviewFileType to set the default file type for initial preview. Defaults to image. Must be on of the keys in fileTypeSettings.initialPreviewConfig. The new properties available within initialPreviewConfig are:
type: Override initialPreviewFileType at global level and set a separate type for each file in the initial preview.previewAsData: boolean property to override the initialPreviewAsData setting at global levelprevnextfullscreenborderlesstoggleheaderclosepreviewZoomSettings: Will allow to set the CSS style (e.g. width, height and other CSS style settings) for each zoomed content type (i.e. image, pdf, video etc.).previewZoomButtonIcons: Ability to set the labels for previous, next, fullscreen, borderless, and close buttons.previewZoomButtonTitles: Ability to set the titles for previous, next, fullscreen, borderless, and close buttons.previewZoomButtonClasses: Ability to set the CSS classes for previous, next, fullscreen, borderless, and close buttons.initialPreview. In addition a new template for PDF is available within previewTemplates.DOMPurify plugin (and available in plugins folder). This processes and cleans the HTML from XSS before previewing. This behavior can be controlled via purifyHtml property that defaults to true.maxFilePreviewSize to control preview of large size files.allowedPreviewTypes.(bug #577): Better label spacing for default browse icon.
Date: 28-Feb-2016
_.peerDependencies.msg param in fileerror, fileuploaderror, and filefoldererror events.removeFromPreviewOnError to false.webkitdirectory for upload.removeFromPreviewOnError to false.(enh #550): Correct Drag and drop issue with v4.2.9.
Date: 25-Jan-2016
(enh #545): Refactor code to deep extend options correctly.
Date: 22-Jan-2016
removeFromPreviewOnError.sass for bootstrap-sass-official support.change and fileselect events.(enh #494): Add Indonesian translations.
Date: 18-Nov-2015
zh-TW translation browseLabel wording.buttonLabelClass.file.(bug #442); Enhance the filenames parsing in the filestack and slug conversion.
Date: 13-Sep-2015
defaultPreviewContent to control a default preview.showClose and new layout template close to control close icon display.fileimageloaded (fires after each image is loaded in preview) - this is an existing eventfileimagesloaded (fires after all images are loaded in preview)fileimageresized (fires after each image in preview is resized)fileimagesresized (fires after all images in preview are resized)fileimageresizeerror (fires when any image resize error is faced)showPreview is false.(enh #426): Enhancements to progress bar and display thumbnail specific progress.
Date: 26-Aug-2015
data.errorkeys more correctly.initialCaption better when preview is cleared.parseError method.fileActionSettings.(enh #372): Create new event filepreajax.
Date: 27-Jul-2015
filepreajax.autoReplace property.(enh #358): Implement event namespaces and enhance event handling process.
Date: 22-Jul-2015
refresh method.destroy method.beforeSend events.previewId and index in extra data for individual thumbnail uploads (ajax).One column per quarter.