jQuery-File-Upload README

The project's README from github.com/blueimp/jQuery-File-Upload. As one markdown file: README.md.

jQuery File Upload

Contents

Description

File Upload widget with multiple file selection, drag&drop support, progress bars, validation and preview images, audio and video for jQuery.
Supports cross-domain, chunked and resumable file uploads and client-side image resizing.
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.

Demo

Demo File Upload

Features

Security

⚠️ Please read the VULNERABILITIES document for a list of fixed vulnerabilities

Please also read the SECURITY document for instructions on how to securely configure your Web server for file uploads.

Setup

jQuery File Upload can be installed via NPM:

npm install blueimp-file-upload

This allows you to include jquery.fileupload.js and its extensions via node_modules, e.g:

<script src="node_modules/blueimp-file-upload/js/jquery.fileupload.js"></script>

The widget can then be initialized on a file upload form the following way:

$('#fileupload').fileupload();

For further information, please refer to the following guides:

Requirements

Mandatory requirements

Optional requirements

Cross-domain requirements

Cross-domain File Uploads using the Iframe Transport plugin require a redirect back to the origin server to retrieve the upload results. The example implementation makes use of result.html as a static redirect page for the origin server.

The repository also includes the jQuery XDomainRequest Transport plugin, which enables limited cross-domain AJAX requests in Microsoft Internet Explorer 8 and 9 (IE 10 supports cross-domain XHR requests).
The XDomainRequest object allows GET and POST requests only and doesn't support file uploads. It is used on the Demo to delete uploaded files from the cross-domain demo file upload service.

Browsers

Desktop browsers

The File Upload plugin is regularly tested with the latest browser versions and supports the following minimal versions:

Mobile browsers

The File Upload plugin has been tested with and supports the following mobile browsers:

Extended browser support information

For a detailed overview of the features supported by each browser version and known operating system / browser bugs, please have a look at the Extended browser support information.

Testing

The project comes with three sets of tests:

  1. Code linting using ESLint.
  2. Unit tests using Mocha.
  3. End-to-end tests using blueimp/wdio.

To run the tests, follow these steps:

  1. Start Docker.
  2. Install development dependencies:
    npm install
    
  3. Run the tests:
    npm test
    

Support

This project is actively maintained, but there is no official support channel.
If you have a question that another developer might help you with, please post to Stack Overflow and tag your question with blueimp jquery file upload.

License

Released under the MIT license.

jQuery-File-Upload (blueimp/jQuery-File-Upload)

Searching Database…

30.7K ·GitHub
archived
这是什么?jQuery File Upload 是一个 jQuery 组件,可为任何 HTML 文件上传表单添加多文件选择、拖放上传、上传进度条、图片/音频/视频预览,以及可续传/分块上传功能,并且几乎可以与任何服务器端后端配合使用。
这是独立的应用,还是我要添加到页面中的插件?它是一个客户端 jQuery 插件/组件:你需要把它绑定到页面上已有的 HTML 文件上传表单,而不是安装单独的应用程序。
我该如何把它添加到我的项目中?通过 NPM 安装,即可从 node_modules 中引入 jquery.fileupload.js 及其扩展;然后在标准的 HTML 文件上传表单上初始化该组件。
除了这个插件本身,我还需要什么?你需要 jQuery v1.7+ 以及随附的 jQuery UI widget factory v1.9+(另外,对于不支持 XHR 的浏览器,还需要附带的 Iframe Transport)。可选的扩展,如 JS Templates 模板引擎和 Load Image 库,可用于实现预览和客户端图片缩放。
这个项目还在积极维护吗?README 称该项目仍在维护,但除了 Stack Overflow 之外没有官方支持渠道,而且 GitHub 仓库目前已被标记为已归档(archived)。
它实际支持哪些浏览器?它面向现代桌面浏览器(Chrome、Safari 4+、Firefox 3+、Opera 11+、IE6+)和移动浏览器(iOS/Android 版 Chrome 6.0+/4.0+、Android 系统自带浏览器 2.3+);对于不支持 XHR 的老旧浏览器,则会回退到 iframe 方式。
它是否解决了文件上传的安全问题?是的。README 链接了专门的 VULNERABILITIES 和 SECURITY 文档,列出了已修复的问题,并说明了如何安全地配置 Web 服务器以处理上传。
能否把文件上传到与页面本身不同的域名?可以。系统支持跨站上传,方式包括跨站 XHR 请求,或通过 iframe 重定向回源服务器;另外还附带了用于旧版 IE 的 XDomainRequest 传输方式。
哪些服务器端语言可以处理上传的文件?任何支持标准 HTML 表单文件上传的平台都可以,包括 PHP、Python、Ruby on Rails、Java、Node.js 和 Go。
能否在上传前缩放图片?可以。在支持所需 JS API 的浏览器中,它可以在客户端缩放图片,并在发送前显示图片、音频和视频的预览。
Creator
blueimp
Size
4.5 MB
Stars
30.7K
Updated
CommitSep 25
Age
15y
Commits · 90 Days