jQuery.filer – Simple HTML5 File Uploader, a plugin tool for jQuery which change completely File Input and make it with multiple file selection, drag&drop support, different validations, thumbnails, icons, instant upload, print-screen upload and many other features and options.
jQuery.filer 1.0.2
jQuery.filer - Simple HTML5 File Uploader, a plugin tool for jQuery which change completely File Input and make it with multiple file selection, drag&drop support, different validations, thumbnails, icons, instant upload, print-screen upload and many other features and options.
Demo | Documentation | Support
Features
- Completely change File Input
- Upload files after choosing
- Add more files to input without uploading them
- Validate files(limit, size, extension)
- Create thumbs
- Custom icons for each type of file
- Custom templates & themes for: input, thumbs, icons
- Remove Choosed/Uploaded files
- Append existing files to input for a preview
- Image paste from clipboard
- Custom captions
- Custom callbacks
- Templates inline variables, ex: {{fi-limit}}
- All icons in a one beautiful font
- Drag & Drop Option
- Trigger options
用法:
Styles:
Include the jquery.filer css file in your html page.
<link href="./css/jquery.filer.css" type="text/css" rel="stylesheet" /> <link href="./css/themes/jquery.filer-dragdropbox-theme.css" type="text/css" rel="stylesheet" />
Scripts:
Include the jQuery library and jquery.filer script file in your html page.
<script src="http://code.jquery.com/jquery-latest.min.js"></script> <script src="./js/jquery.filer.min.js"></script>
HTML:
Create an input file element.
<form action="./php/upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="files[]" id="input_file" multiple="multiple"> <input type="submit"> </form>
Javascript:
The plugin is named "filer" and can be applied to any element. You will probably also specify some options while applying the plugin. If you are not familiar with jQuery, please, read this tutorial for beginners.
$(document).ready(function() { $('#input_file').filer({ limit: null, maxSize: null, extensions: null, changeInput: true, showThumbs: true, appendTo: null, theme: "default", templates: { box: '<ul class="jFiler-item-list"></ul>', item: '<li class="jFiler-item"> <div class="jFiler-item-container"> <div class="jFiler-item-inner"> <div class="jFiler-item-thumb"> <div class="jFiler-item-status"></div> <div class="jFiler-item-info"> <span class="jFiler-item-title"><b title="{{fi-name}}">{{fi-name | limitTo: 25}}</b></span> </div> {{fi-image}} </div> <div class="jFiler-item-assets jFiler-row"> <ul class="list-inline pull-left"> <li>{{fi-progressBar}}</li> </ul> <ul class="list-inline pull-right"> <li><a class="icon-jfi-trash jFiler-item-trash-action"></a></li> </ul> </div> </div> </div> </li>', itemAppend: '<li class="jFiler-item"> <div class="jFiler-item-container"> <div class="jFiler-item-inner"> <div class="jFiler-item-thumb"> <div class="jFiler-item-status"></div> <div class="jFiler-item-info"> <span class="jFiler-item-title"><b title="{{fi-name}}">{{fi-name | limitTo: 25}}</b></span> </div> {{fi-image}} </div> <div class="jFiler-item-assets jFiler-row"> <ul class="list-inline pull-left"> <span class="jFiler-item-others">{{fi-icon}} {{fi-size2}}</span> </ul> <ul class="list-inline pull-right"> <li><a class="icon-jfi-trash jFiler-item-trash-action"></a></li> </ul> </div> </div> </div> </li>', progressBar: '<div class="bar"></div>', itemAppendToEnd: false, removeConfirmation: true, _selectors: { list: '.jFiler-item-list', item: '.jFiler-item', progressBar: '.bar', remove: '.jFiler-item-trash-action', } }, uploadFile: { url: "./php/upload.php", data: {}, type: 'POST', enctype: 'multipart/form-data', beforeSend: function(){}, success: function(data, el){ var parent = el.find(".jFiler-jProgressBar").parent(); el.find(".jFiler-jProgressBar").fadeOut("slow", function(){ $("<div class="jFiler-item-others text-success"><i class="icon-jfi-check-circle"></i> Success</div>").hide().appendTo(parent).fadeIn("slow"); }); }, error: function(el){ var parent = el.find(".jFiler-jProgressBar").parent(); el.find(".jFiler-jProgressBar").fadeOut("slow", function(){ $("<div class="jFiler-item-others text-error"><i class="icon-jfi-minus-circle"></i> Error</div>").hide().appendTo(parent).fadeIn("slow"); }); }, statusCode: {}, onProgress: function(){}, onComplete: function(){} }, dragDrop: { dragEnter: null, dragLeave: null, drop: null, }, addMore: true, clipBoardPaste: true, excludeName: null, beforeShow: function(){return true}, onSelect: function(){}, afterShow: function(){}, onRemove: function(){}, onEmpty: function(){}, captions: { button: "Choose Files", feedback: "Choose files To Upload", feedback2: "files were chosen", drop: "Drop file here to Upload", removeConfirmation: "Are you sure you want to remove this file?", errors: { filesLimit: "Only {{fi-limit}} files are allowed to be uploaded.", filesType: "Only Images are allowed to be uploaded.", filesSize: "{{fi-name}} is too large! Please upload file up to {{fi-maxSize}} MB.", filesSizeAll: "Files you've choosed are too large! Please upload files up to {{fi-maxSize}} MB." } } }); });
Options & Features
Fully documentation of plugin options and features.
Options:
- limit Maximum Limit of files. {null, Number}
- maxSize Maximum Size of files. {null, Number(in MB's)}
- extensions Whitelist for file extension. {null, Array}
- changeInput Change input. {Boolean, String(HTML element), Object(DOM Element)}
- showThumbs Show input files as thumbnails. {Boolean}
- appendTo Append thumbnails to element. {null, String(Dom Element)}
- theme jQuery.filer theme. {null, String}
-
templates
- box Thumbnails box element {null, String}
- item Thumbnails file item element {String(use Filer Variables), Function}
- itemAppend Thumbnails appended file item element {String(use Filer Variables), Function}
- progressBar Thumbnails file item upload progress bar element {String}
- itemAppendToEnd Append file item to the end of list {Boolean}
- removeConfirmation Remove file confirmation {Boolean}
-
selectors
- list List selector {String}
- item Item selector {String}
- progressBar Progress bar selector {String}
- remove Remove button selector {String}
-
uploadFile
- url URL to which the request is sent {String}
- data Data to be sent to the server {Object}
- type The type of request {String}
- enctype Request enctype {String}
- beforeSend A pre-request callback function {Function}
- success A function to be called if the request succeeds {Function}
- error A function to be called if the request fails {Function}
- statusCode An object of numeric HTTP codes {Object}
- onProgress A function called while uploading file with progress percentage {Function}
- onComplete A function called when all files were uploaded {Function}
-
dragDrop
- dragEnter A function that is fired when a dragged element enters the input. {Function}
- dragLeave A function that is fired when a dragged element leaves the input. {Function}
- drop A function that is fired when a dragged element is dropped on a valid drop target.
- addMore Multiple file selection without instant uploading {Boolean}
- clipBoardPaste Printscreen paste and upload {Boolean}
- excludeName Removed files input name {null, String} Default: jfiler-items-exclude-(input file name)-(input index)
- beforeShow A function that is fired before showing thunbnails {Function}
- onSelect A function that is fired after selecting files {Function}
- afterShow A function that is fired after appending all thumbnails items {Function}
- onRemove A function that is fired after deleting a file {Function}
- onEmpty A function that is fired when no files are selected {Function}
-
captions
- button New Input button text {String}
- feedback New Input field text {String}
- feedback2 New Input after choosing files text {String}
- drop New Input on drag text {String}
- removeConfirmation Remove file confirmation text {String}
-
errors
- filesLimit {String(use Filer Variables)}
- filesType {String(use Filer Variables)}
- filesSize {String(use Filer Variables)}
- filesSizeAll {String(use Filer Variables)}
Triggers:
- $('#input_file').trigger("filer.append", {files:[]})
- $('#input_file').trigger("filer.remove", {id:0})
- $('#input_file').trigger("filer.reset")
- $('#input_file').trigger("filer.getList", {files:[]})
- $('#input_file').trigger("filer.retry", here_is_file_id)
Attributes:
- data-jfiler-name | name of input (is used while applying plugin to a non file input)
- data-jfiler-limit | files limit
- data-jfiler-maxSize | files maximum size
- data-jfiler-extensions | separeted with comma
- data-jfiler-changeInput | {Boolean, String}
- data-jfiler-showThumbs | show thumbnails
- data-jfiler-appendTo | append thumbnails to selector
- data-jfiler-theme | custom filer theme
- data-jfiler-excludeName | exclude files input name
- data-jfiler-files | append files, ex: "{"files":[{"name":"appended_file.jpg","size":5453,"type":"image/jpg",file:"/path/to/file/appended_file.jpg"}]}"
项目地址:https://github.com/CreativeDream/jquery.filer
转自:jQuery Filer : jQuery Html5 File Uploader 多文件上传
相关推荐
jQuery.filer - 简单的 HTML5 文件上传器,一个 jQuery 插件工具,它完全改变了文件输入并使其具有多个文件选择、拖放支持、不同的验证、缩略图、图标、即时上传、打印屏幕上传和许多其他功能和选项. | 特征 完全...
插件描述:jQuery.filer是一款简单的HTML5文件上传组件美化jQuery插件。它能够完成单文件和多文件的上传,支持文件的拖拽,支持不同的文件格式校验,支持缩略图和图标等,是一款非常实用的文件上传插件。演示地址:...
该插件使用来浏览目录中的文件。 受到启发, 。 安装 Plug 'Yggdroot/LeaderF' Plug 'tamago324/LeaderF-filer' 如果使用remove_trash和remove_trash_force ,则需要 。 用法 :Leaderf filer :Leaderf filer --...
本文将深入探讨如何使用jQuery实现多文件上传功能,并结合Java后端进行处理。多文件上传是一个常见的需求,特别是在Web应用程序中,允许用户一次性上传多个文件可以极大地提高用户体验。 首先,我们需要在前端使用...
首先,jQuery.filer插件支持单文件和多文件的上传,用户可以根据需求选择上传一个或多个文件。这种灵活性使得插件适用于各种类型的项目,无论是个人博客、电子商务平台还是企业级应用。 其次,该插件提供了文件拖放...
jsp、jquery、jQuery.filer+后台JAVA SpringMcv 实现推拽,批量上传功能。 1、实现数据报表展示 2、新增,编辑,图片删除(物理删除) 3、优化图片预览,点击放大(再次点击隐藏) 4、优化上传图片时动态传递参数,...
jQuery.filer是一款简单的HTML5文件上传组件美化jQuery插件。它能够完成单文件和多文件的上传,支持文件的拖拽,支持不同的文件格式校验,支持缩略图和图标等,是一款非常实用的文件上传插件。
- **引入资源**:首先,你需要将`jquery.fileDownload-1.4.5.js`文件引入到你的HTML页面中。 ``` <script src="path/to/jquery.fileDownload-1.4.5.js"> ``` - **设置文件URL**:定义你要下载的文件URL。 ```...
1. **路由配置**:`filer`定义了路由规则,将特定的URL路径映射到本地文件系统中的目录或文件。 2. **错误处理**:对于无法访问的文件或者目录,`filer`会返回合适的HTTP状态码和错误信息。 3. **缓存控制**:可能...
文件管理器Filer是一个开源文件加密和解密程序。入门推荐使用Visual Studio Code(可以使用所需的代码),Filer已正式完成并经过测试,因此它完全安全且易于使用。 首先使用git clone ...
文件管理器Filer替代了Node的fs模块, fs模块是用于浏览器的类似于POSIX的文件系统。兼容性Filer使用 ,并且: node.js:v0.10。* + IE:10以上边缘:12+ Firefox:10岁以上Chrome:23+ Safari:10岁以上歌剧:15岁...
2. **多文件类型支持**:除了支持图像文件,`django-filer` 还能处理各种文档、音频和视频文件,使得管理不同类型媒体变得简单。 3. **图像处理**:对于图像文件,`django-filer` 提供了裁剪、缩放、旋转等基本编辑...
5. **设置与安装**: 在Django项目中使用django-ckeditor-filer,需要先安装这两个库,然后在settings.py中配置相关应用,更新URL配置,以及可能的模板和静态文件设置。通常还需要配置CKEditor的配置项,以连接到...
Filer 支持多文件上传、文件夹结构、权限控制以及多种文件类型的处理,尤其适合在内容管理系统中使用。 当 **django-ckeditor-filer** 将两者结合时,用户可以直接在 CKEditor 编辑窗口内通过 Filer 的界面上传和...
文件上传在网页中应用十分广泛,对于一般的文件上传控件,基本都是浏览器自带的外观,而且也没有文件信息的展示,比如文件大小、文件类型等,也没有对文件进行预览,特别是图片。今天要介绍的这款插件不仅让文件上传...
onUploadStart: function(file) {//上传开始时触发(每个文件触发一次) alert( 'id: ' + file.id + ' - 索引: ' + file.index + ' - 文件名: ' + file.name + ' - 文件大小: ' + file.size + ' - 类型: '...
标题中的“filer:从目录获取文件并将它们分配给数组”是指一个JavaScript项目,它提供了一种功能,可以遍历指定的目录,收集其中的文件,并将这些文件的信息存储到一个数组中。这样的功能在处理大量文件时非常有用,...
环境文件管理器 :card_file_box: 一个很小的软件包,可以帮助您管理点文件安装yarn add env-filer 或npm npm -i env-filer用法filer ( name , [ dir , [ ( options = { usePromises : false } ) ] ] ) ; 命名用于点...
文件管理器 Filer是一个自动文件组织器。 它使用打开的文件或丢弃的文件,并根据用户创建的规则对其进行移动,重命名,复制或执行各种其他操作。 Filer随附有AutoFiler。 无需处理用户提供的一组文件,而是可以启动...
MK-filer 是经典的两面板文件管理器,用于由 NPP SEMIKO(新西伯利亚)制造的键盘。