bootstrap-fileinput
===================
[![Bower version](https://badge.fury.io/bo/bootstrap-fileinput.svg)](http://badge.fury.io/bo/bootstrap-fileinput)
[![Latest Stable Version](https://poser.pugx.org/kartik-v/bootstrap-fileinput/v/stable)](https://packagist.org/packages/kartik-v/bootstrap-fileinput)
[![License](https://poser.pugx.org/kartik-v/bootstrap-fileinput/license)](https://packagist.org/packages/kartik-v/bootstrap-fileinput)
[![Packagist Downloads](https://poser.pugx.org/kartik-v/bootstrap-fileinput/downloads)](https://packagist.org/packages/kartik-v/bootstrap-fileinput)
[![Monthly Downloads](https://poser.pugx.org/kartik-v/bootstrap-fileinput/d/monthly)](https://packagist.org/packages/kartik-v/bootstrap-fileinput)
An enhanced HTML 5 file input for Bootstrap 3.x with file preview for various files, offers multiple selection, and more. The plugin allows you a simple way to setup an advanced file picker/upload control built to work specially with Bootstrap CSS3 styles. It enhances the file input functionality further, by offering support to preview a wide variety of files i.e. images, text, html, video, audio, flash, and objects. In addition, it includes AJAX based uploads, dragging & dropping files, viewing upload progress, and selectively previewing, adding, or deleting files.
![File Input Screenshot](https://lh3.googleusercontent.com/-3FiEmc_okc4/VBw_d2LBAJI/AAAAAAAAAL8/KbVj5X9Dus0/w596-h454-no/FileInput.jpg)
> NOTE: The latest version of the plugin is v4.3.6. Refer the [CHANGE LOG](https://github.com/kartik-v/bootstrap-fileinput/blob/master/CHANGE.md) for details.
## Documentation and Demo
View the [plugin documentation](http://plugins.krajee.com/file-input) and [plugin demos](http://plugins.krajee.com/file-input/demo) at Krajee JQuery plugins.
## Pre-requisites
1. [Bootstrap 3.x](http://getbootstrap.com/)
2. Latest [JQuery](http://jquery.com/)
3. Most modern browsers supporting HTML5 (inputs and FileReader API) including CSS3 & JQuery. For Internet Explorer, one must use IE versions 10 and above. IE9 and below will work as a normal file input, and will not support multiple file selection or the HTML 5 FileReader API.
4. With release 4.0, AJAX uploads are supported. AJAX uploads require that the browser support HTML5 FormData and XHR2 (XMLHttpRequest 2). Most modern browsers support FormData and XHR2. The plugin will automatically degrade to normal form based submission for browsers not supporting AJAX uploads.
> NOTE: You can use the [sass branch](https://github.com/kartik-v/bootstrap-fileinput/tree/sass) for installation using `bootstrap-sass` dependency.
The [master branch](https://github.com/kartik-v/bootstrap-fileinput/tree/master) can be used for installation using plain `bootstrap` dependency.
## Installation
### Using Bower
You can use the `bower` package manager to install. Run:
bower install bootstrap-fileinput
### Using Composer
You can use the `composer` package manager to install. Either run:
$ php composer.phar require kartik-v/bootstrap-fileinput "@dev"
or add:
"kartik-v/bootstrap-fileinput": "@dev"
to your composer.json file
### Manual Install
You can also manually install the plugin easily to your project. Just download the source [ZIP](https://github.com/kartik-v/bootstrap-fileinput/zipball/master) or [TAR ball](https://github.com/kartik-v/bootstrap-fileinput/tarball/master) and extract the plugin assets (css and js folders) into your project.
## Usage
Step 1: Load the following assets in your header.
```html
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<link href="path/to/css/fileinput.min.css" media="all" rel="stylesheet" type="text/css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- canvas-to-blob.min.js is only needed if you wish to resize images before upload.
This must be loaded before fileinput.min.js -->
<script src="path/to/js/plugins/canvas-to-blob.min.js" type="text/javascript"></script>
<!-- sortable.min.js is only needed if you wish to sort / rearrange files in initial preview.
This must be loaded before fileinput.min.js -->
<script src="path/to/js/plugins/sortable.min.js" type="text/javascript"></script>
<!-- purify.min.js is only needed if you wish to purify HTML content in your preview for HTML files.
This must be loaded before fileinput.min.js -->
<script src="path/to/js/plugins/purify.min.js" type="text/javascript"></script>
<!-- the main fileinput plugin file -->
<script src="path/to/js/fileinput.min.js"></script>
<!-- bootstrap.js below is needed if you wish to zoom and view file content
in a larger detailed modal dialog -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" type="text/javascript"></script>
<!-- optionally if you need a theme like font awesome theme you can include
it as mentioned below -->
<script src="path/to/themes/fa/theme.js"></script>
<!-- optionally if you need translation for your language then include
locale file as mentioned below -->
<script src="path/to/js/locales/<lang>.js"></script>
```
If you noticed, you need to load the `jquery.min.js` and `bootstrap.min.css` in addition to the `fileinput.min.css` and `fileinput.min.js`. The theme file `themes/fa/theme.js` can be optionally included for the font awesome icons styling. The locale file `<lang>.js` can be optionally included for translating for your language if needed.
**Optional Dependent Plugins**
- The `canvas-to-blob.min.js` file is the source for the [JavaScript-Canvas-to-Blob plugin by blueimp](https://github.com/blueimp/JavaScript-Canvas-to-Blob). It is required to be loaded before `fileinput.min.js` if you wish to use the image resize feature of the **bootstrap-fileinput** plugin.
- The `sortable.min.js` file is the source for the [Sortable plugin by rubaxa](https://github.com/rubaxa/Sortable). It is required to be loaded before `fileinput.min.js` if you wish to sort the thumbnails in the initial preview.
- The `purify.min.js` file is the source for the [DomPurify plugin by cure53](https://github.com/cure53/DOMPurify). It is required to be loaded before `fileinput.min.js` if you wish to purify your HTML for HTML content preview.
For ease of access, the sources for the above plugins are included in the `js/plugins` folder of this project repository.
Step 2: Initialize the plugin on your page. For example,
```js
// initialize with defaults
$("#input-id").fileinput();
// with plugin options
$("#input-id").fileinput({'showUpload':false, 'previewFileType':'any'});
```
The `#input-id` is the identifier for the input (e.g. `type = file`) on your page, which is hidden automatically by the plugin.
Alternatively, you can directly call the plugin options by setting data attributes to your input field.
```html
<input id="input-id" type="file" class="file" data-preview-file-type="text" >
```
## License
**bootstrap-fileinput** is released under the BSD 3-Clause License. See the bundled `LICENSE.md` for details.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
springmvc图片上传带进度条实例 (630个子文件)
build.bat 1014B
ImageService.class 5KB
TestController.class 4KB
CustomMultipartResolver.class 3KB
ErrorCode.class 3KB
Systemup.class 2KB
BaseReturn.class 2KB
FileUploadProgressListener.class 1KB
Progress.class 1KB
UUIDGenerator.class 1KB
BaseReturn$GsonObject.class 1KB
BeanFactory.class 867B
Config.class 661B
.classpath 727B
org.eclipse.wst.common.component 586B
org.eclipse.wst.jsdt.ui.superType.container 49B
weui.css 195KB
bootstrap.css 143KB
bootstrap.min.css 118KB
bootstrap.min.css 107KB
ionicons.css 47KB
ionicons.min.css 42KB
material-design-iconic-font.css 38KB
font-awesome.css 37KB
weui.min.css 35KB
material-design-iconic-font.min.css 32KB
font-awesome.min.css 30KB
font-awesome.css 26KB
bootstrap-theme.css 26KB
font-awesome.css 25KB
bootstrap-theme.min.css 23KB
font-awesome.css 22KB
typicons.css 22KB
font-awesome.min.css 21KB
font-awesome.min.css 20KB
font-awesome.min.css 20KB
bootstrap-social.css 19KB
bootstrap-theme.min.css 18KB
font-awesome.min.css 18KB
dataTables.jqueryui.css 16KB
jquery.dataTables.css 15KB
elusive-icons.css 15KB
typicons.min.css 15KB
jquery.dataTables_themeroller.css 14KB
dataTables.jqueryui.min.css 14KB
map-icons.css 14KB
jquery.dataTables.min.css 13KB
dataTables.jqueryui.css 13KB
elusive-icons.min.css 13KB
bootstrap-datetimepicker.css 12KB
map-icons.min.css 12KB
octicons.css 11KB
bootstrap-datetimepicker.min.css 11KB
octicons.min.css 9KB
awesome.css 8KB
templatemo_style.css 8KB
dataTables.bootstrap.css 7KB
weather-icons.css 7KB
fileinput.css 7KB
metroStyle.css 6KB
weather-icons.min.css 6KB
zTreeStyle.css 6KB
fileinput.min.css 6KB
sb-admin-2.css 5KB
dataTables.bootstrap.css 5KB
dataTables.bootstrap.css 5KB
dataTables.foundation.css 5KB
dataTables.bootstrap.min.css 4KB
timeline.css 3KB
dataTables.fontAwesome.css 3KB
dataTables.foundation.css 3KB
dataTables.foundation.min.css 3KB
dataTables.responsive.css 2KB
demo.css 2KB
metisMenu.css 1KB
bootstrap-iconpicker.css 993B
easyform.css 953B
bootstrap-iconpicker.min.css 824B
metisMenu.min.css 781B
dataTables.alphabetSearch.css 552B
dataTables.bootstrap.css 369B
dataTables.searchHighlight.css 67B
dataTables.lengthLinks.css 50B
fontawesome-webfont.eot 162KB
Material-Design-Iconic-Font.eot 140KB
ionicons.eot 100KB
typicons.eot 98KB
fontawesome-webfont.eot 71KB
fontawesome-webfont.eot 71KB
Elusive-Icons.eot 60KB
fontawesome-webfont.eot 55KB
map-icons.eot 39KB
fontawesome-webfont.eot 37KB
weathericons-regular-webfont.eot 34KB
octicons.eot 31KB
glyphicons-halflings-regular.eot 20KB
zTreeStandard.gif 5KB
metro.gif 5KB
loading-sm.gif 3KB
loading.gif 847B
共 630 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
桔梗花语啊
- 粉丝: 17
- 资源: 33
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功