HtML5多文件上傳:Bootstrap File Input
這是一個增強的 HTML5 文件輸入控件,是一個 Bootstrap 3.x 的擴展,實現文件上傳預覽,多文件上傳等功能。
特性
- The plugin will convert a simple HTML file input to an advanced file picker control. Will help fallback to a normal HTML file input for browsers not supporting JQuery or Javascript.
- The file input consists of the following three sections with options and templates to control the display:
- file caption section: to display a brief information of the file(s) selected
- file action buttons section: to browse, remove, and upload files.
- file preview section: to display the selected files on client for preview (supports images and text file types). Other file types will be displayed as normal thumbnails.
- The plugin automatically converts an input with
type = file
to an advanced file picker input if you set itsclass = file
. All options to the input can be passed as HTML5data
attributes. - Ability to select and preview multiple files. Uses HTML 5 File reader API to read and preview files. Displays the progress of files being being loaded onto the preview zone, in case many files are chosen.
- Offers predefined templates and CSS classes which can be changed to style your file-input display as per your needs.
- With v1.5.0, you can now configure the plugin to show an initial preview of images/files with initial caption (more useful for record update scenarios). Refer the
initialPreview
andinitialCaption
properties in the plugin options section for configuring this. - Option to show/hide any or all of the following:
- caption section
- preview section
- upload button
- remove button
- Customise the location of the target container elements to display the entire plugin, the caption container, the caption text, the preview container, preview image, and preview status.
- For text file previews, autowrap the text to the thumbnail width, and show a wrap indicator link to display complete text on hover. You can customize the wrap indicator (which defaults to …).
- Customise the messages for preview, progress, and files selected.
- Upload action defaults to form submit. Supports an upload route/server action parameter for custom ajax based upload.
- Triggers JQuery events for advanced development. Events currently available are
filereset
andfileclear
. - Disabled and readonly file input support.
- Size of the entire plugin is less than 11KB (about 9KB for the minified JS and 2KB for the minified CSS).
示例
View the plugin documentation and plugin demos at Krajee JQuery plugins.

本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!