NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist, #2254 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.
(enh #336): Fixes to reset preview via initUploadSuccess.
Date: 21-Jun-2015
initUploadSuccess.(enh #332): Bump nuget and bower package versions.
Date: 18-Jun-2015
(enh #330): Minor enhancements in validating preview and progress bar display.
Date: 15-Jun-2015
minImageWidthminImageHeightmaxImageWidthmaxImageHeightmsgImageWidthSmallmsgImageHeightSmallmsgImageWidthLargemsgImageHeightLargedata.error being empty.initialPreviewConfig.revokeObjectURL.showUploadedThumbs that will display uploaded thumbnails until the remove/clear button is explicitly pressed.filesuccessremove. This will be triggered on removing the uploaded thumbnail using the thumbnail delete button. The event shares the following parameters:
id: the HTML id attribute of the thumbnail container
The event can be set to return false to abort the thumbnail removal.overwriteInitial correctly for ajax uploads.Your coding agent can read these notes before it upgrades. Set up the MCP server →
(enh #277): New language property to allow configuring multi lang widgets on same page.
Date: 11-May-2015
language property to allow configuring multi lang widgets on same page.(bug #273): Reset caption correctly after all initial preview is deleted.
Date: 02-May-2015
deleteExtraData.(enh #230): More correct initial preview delete reset.
Date: 30-Mar-2015
previewThumbTags and initialPreviewThumbTags will be available for configuration.filebatchselected event is triggered after FileReader completes reading files selected.showAjaxErrorDetails.msgFoldersNotAllowed added to the plugin to allow configuring the message shown. The event filefoldererror is triggered when a folder is dragged.filebatchuploadsuccess or filebatchuploadcomplete) e.g. change, fileselect, filepreupload, filebatchpreupload etc. The object can return the following keys:
message: string, the validation error message to be displayed before upload. If this is set the plugin will automatically abort the upload whenever called and display this as an error message. You can use this property for example to read a file and perform your own custom validation.data: object, an optional associative array of additional data that you can pass for usage later.abortData in the parameters for the new filecustomerror event. This new event will be triggered during upload, when you have triggered an abort from any of the other events.filebatchuploadcomplete & filebatchuploadsuccess.
initialPreview and initialPreviewConfig after an ajax upload by returning these within the data object from your ajax response on fileuploaded & filebatchuploadsuccess.fileMinCount and msgFilesTooLess (useful to make file input mandatory).
fileMinCount property will allow to set the minimum file count needed before triggering upload. It will work for both ajax uploads and normal form based submission.fileMinCount = 1). The msgFilesTooLess will be displayed and error raised.fileMinCount is set to 0 it will be treated as files are optional and no error will be triggered.$.fn.fileinput.locales['<lang-code>']$.fn.fileinput.locales['en'] within the plugin core code<lang>.jsfilebatchuploadcomplete on async batch upload completion.ajaxDeleteSettings to help extend and add to delete ajax settings.ajaxSettings to help extend and add upload ajax settingspreviewFileIcon to configure file icon shown in preview for unreadable file types.maxFileSize and maxFileCount to numeric - even if they have been setup as a string.false.initialPreviewConfig.deleteUrl property.deleteExtraData property for ajax deletions.Relocate sample files from examples directory to bootstrap-fileinput-samples repo.
Date: 13-Feb-2015
outData for events.progressClass: styling for progress bar when upload is in processprogressCompleteClass: styling for progress bar when upload is completemsgFileSecured will display the security exception message.replaceAll method instead of regexp parsing to replace tags in templates.filebatchselected event triggered after every batch of files are selected.customLayoutTags and customPreviewTags included).(enh #139): Reset file stack correctly on ajax upload completion.
Date: 20-Jan-2015
filedisabled and fileenabled.(enh #121): Animate progress bars by default for upload progress.
Date: 12-Jan-2015
(bug #97): Reset events correctly with plugin refresh method.
Date: 26-Dec-2014
filebatchpreupload for both synchronous and asynchronous batch uploads.otherActionButtons to allow adding customized initial preview content actions.(enh #87): More correct progress indicator percentage for asynchronous upload.
Date: 20-Dec-2014
filepreuploadfileuploadedfileuploaderrorfilebatchuploaderrorfilebatchuploadsuccessfilebatchuploadcomplete(enh #80): Allow access to uploadExtraData and responseData to following events
Date: 19-Dec-2014
filebatchuploadsuccessfilebatchuploadcompleteuploadExtraData and responseData to following events
filepreuploadfileuploadedfileuploaderrorfilebatchuploaderrorfilebatchuploadsuccessfilebatchuploadcompletefilelockfileunlock(bug #78): Set uploadExtraData parameters to be correctly sent via POST.
Date: 18-Dec-2014
showPreview is false.textEncoding for reading the text files with right encoding.(enh #75): Better validation of browser support for drag and drop.
Date: 17-Dec-2014
(bug #72): Fix bootstrap ## version constraint.
Date: 14-Dec-2014
initialDelimiter to initialPreviewDelimiteruploadUrl property is MANDATORY and must be set.showPreview is set to false, or uploadUrl is not supported plugin will degrade to normal form based upload.showCancel: shows a cancel button for aborting ajax uploads (defaults to true).cancelLabel: label for the cancel button.cancelTitle: title for the cancel button on hover.cancelIcon: icon markup for the cancel buttoncancelClass: CSS class for the cancel button.removeTitle: title for the remove button on hover.uploadTitle: title for the upload button on hover.uploadUrl: the url that will be used to process AJAX based uploads (using FormData XHR2).uploadExtraData: extra data that will be passed as data to the url/AJAX server call via POSTuploadAsync: whether the batch upload of multiple files will be asynchronous/in parallel. Defaults to true.initialPreviewShowDelete: shows a delete button for each initial preview content's thumbnail (defaults to true).initialPreviewConfig: configuration for setting up each initialPreviewContent item (associative array/object)
caption: The caption or filename to display for each initial preview item content.width: The CSS width of the image/content displayed.url: The URL for deleting the image/content via AJAX (shown only for initialPreviewContent).key: The key that will be passed to the URL via POST (shown only for initialPreviewContent).dropZoneEnabled: Enable a drag and drop zone for dragging files and is available only for ajax based uploads (defaults to true).dropZoneTitle: Title to be displayed in the drag & drop zone.dropZoneTitleClass: CSS class for the drag & drop zone title.fileActionSettings: configuration for setting up actions for newly selected file thumbnails in the preview (associative array/object)
removeIcon: icon for remove button to be displayed in each file thumbnail.removeClass: CSS class for the remove button in each file thumbnail.removeTitle: title for remove button in each file thumbnail.uploadIcon: icon for upload button to be displayed in each file thumbnail.uploadClass: CSS class for the remove button in each file thumbnail.uploadTitle: title for remove button in each file thumbnail.indicatorNew: an indicator (HTML markup) for new pending upload displayed in each file thumbnail.indicatorSuccess: an indicator (HTML markup) for successful upload displayed in each file thumbnail.indicatorError: an indicator (HTML markup) for error in upload displayed in each file thumbnail.indicatorLoading: an indicator (HTML markup) for ongoing upload displayed in each file thumbnail.indicatorNewTitle: title to display on hover of indicator for new pending upload in each file thumbnail.indicatorSuccessTitle: title to display on hover of indicator for successful in each file thumbnail.indicatorErrorTitle: title to display on hover of indicator for error in upload in each file thumbnail.indicatorLoadingTitle: title to display on hover of indicator for ongoing upload in each file thumbnail.(bug #68): Fix refresh method of the fileinput to trigger change correctly.
Date: 08-Dec-2014
refreshPreview using updateFileDetails.slugCallback property.<a> tag.(enh #56): Trigger new events filebrowse and fileselectnone.
Date: 23-Nov-2014
filebrowse and fileselectnone.(enh #52): Raise new fileimageloaded event.
Date: 13-Nov-2014
fileimageloaded event.autoFitCaption
is added which defaults to true. When this is true the plugin will auto fit caption text within the container dynamically
and responsively based on window size.(enh #49): Set image preview dimensions to auto fit and center
Date: 11-Nov-2014
fileloaded event when showPreview is false.(bug #44): Browser IE10 hangs on file clear.
Date: 15-Oct-2014
elErrorContainer for displaying validation errors.(bug #40): Fix IE (ver < 11) inability to clear fileinput values.
Date: 09-Oct-2014
> Note: There are BC Breaking Changes with release v2.4.0.
Date: 20-Sep-2014
Note: There are BC Breaking Changes with release v2.4.0.
With release v2.4.0, the plugin has been revamped to support and configure a wide variety of file formats for preview. This may break some backward compatibility (BC) for older versions that use custom templates.
The following are the major changes with release v2.4.0:
image, text, html, video, audio, flash, object, and other.allowedPreviewTypes: You can now configure which all file types are allowed to be shown as a preview. This defaults to ['image', 'html', 'text', 'video', 'audio', 'flash', 'object'].
Thus all file types are treated as an object to preview by default. For exampleTo preview only image and video, you can set this to ['image', 'video'].allowedPreviewMimeTypes: In addition to allowedPreviewTypes, you can also control which all mime types can be displayed for preview. This defaults to null,
meaning all mime types are supported.layoutTemplates: Allows you to configure all layout template settings within one property. The layout objects that can be configured are: main1, main2,
preview, caption, and modal.previewTemplates: All preview templates for each preview type have been combined into one property, instead of separate templates for image, text etc.
The keys are the formats as set in allowedPreviewTypes and values are the templates used for previewing. There are default prebuilt templates for each
preview file type (generic, image, text, html, video, audio, flash, object, and other). The generic template is used only for displaying
initialPreview content using direct markup.previewSettings: Allows you to configure width and height for each preview image type. The plugin has default widths and heights predefined for each type i.e
image, text, html, video, audio, flash, and object.fileTypeSettings: Allows you to configure and identify each preview file type using a callback. The plugin has default callbacks predefined to identify each type i.e
image, text, html, video, audio, flash, and object.NOTE: Flash preview will require Shockwave flash to be installed and supported by the client browser. The flash preview currently works successfully with webkit browsers only. Video & Audio formats are however supported by all modern browsers that support the HTML5
video/audiotags. Note that browsers have limited number of video/audio formats supported by the HTML5 video element (e.g. mp4, webm, ogg, mp3, wav). The size of video files are recommended to be small (to be controlled throughmaxFileSizeproperty) so that it does not affect the preview performance. You can copy a few files from theexamplesdirectory of this plugin repo, to test a few examples of flash and video files.
Better replacement of tags in templates. Replaces all tag occurences with this new release.
Date: 19-Sep-2014
(enh #25): Graceful degrade to normal file input for older browsers (including previous versions of Safari).
Date: 19-Aug-2014
(enh #22): Enhance file caption message display for validation errors.
Date: 11-Aug-2014
fileloaded event to increment previewId and enhance to return file index.msgFilesTooMany, msgFileNotFound, msgFileNotReadable, msgFilePreviewAborted, and msgFilePreviewError.maxFilesCount. Defaults to 0 which means unlimited.Added delimiter option for initialPreview to pass multiple content delimited as a string.
Date: 25-Jul-2014
initialPreview to pass multiple content delimited as a string.initPreview is false.msgSelected.disable, enablefileerror, fileloaded, filecleared.maxFileSize configuration.(enh #10): Ability to display initial caption, when initialPreview is false.
Date: 21-Jul-2014
(enh #9): Enhanced caption template and styling for captions to prevent overflow of long file names out of the caption container.
Date: 15-Jul-2014
The plugin now offers an additional overwriteInitial option. This is by default set to true, whereby, any initialPreview content set will be overwritt
Date: 02-Jul-2014
overwriteInitial option. This is by default set to true, whereby, any initialPreview content set will be overwritten, when new file is uploaded or when files are cleared. Setting it to false will help displaying a saved image or file from database always - useful especially when using the multiple file upload feature.The plugin now offers an additional refresh method. This enables you to dynamically change element attributes or plugin options at runtime and refresh
Date: 03-Jun-2014
refresh method. This enables you to dynamically change element attributes or plugin options at runtime and refresh the widget.The plugin now offers an option to display initial preview of images/text/other files. This is useful for record update scenarios. This can be a singl
Date: 23-May-2014
Initial release. The following features are included in this release:
Date: 01-Jan-2014
Initial release. The following features are included in this release:
type = file to an advanced file picker input if you set its class = file. All options to the input can be passed as HTML5 data attributes.filereset and fileclear.One column per quarter.