Convert Figma logo to code with AI

fex-team logowebuploader

It's a new file uploader solution!

7,708
2,334
7,708
2,424

Top Related Projects

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

28,920

The next open source file uploader for web browsers :dog:

Multiple file upload plugin with image previews, drag and drop, progress bars. S3 and Azure support, image scaling, form support, chunking, resume, pause, and tons of other features.

2,959

A JavaScript library providing multiple simultaneous, stable, fault-tolerant and resumable/restartable file uploads via the HTML5 File API.

18,054

Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.

Quick Overview

WebUploader is a modern, feature-rich file upload library for the web. It provides a simple and intuitive interface for uploading files, with support for multiple file selection, progress tracking, and automatic retries on failure. The library is designed to be highly customizable and extensible, making it a versatile choice for a wide range of web applications.

Pros

  • Robust File Handling: WebUploader supports a wide range of file types, including images, documents, and archives, and can handle large file uploads with ease.
  • Responsive and Accessible: The library is designed to be responsive and accessible, with a clean and modern user interface that works well on a variety of devices and screen sizes.
  • Customizable and Extensible: WebUploader is highly customizable, with a range of options and events that allow developers to tailor the library to their specific needs. It also supports a plugin system for adding additional functionality.
  • Cross-Browser Compatibility: The library is designed to work seamlessly across a wide range of modern web browsers, ensuring a consistent user experience.

Cons

  • Dependency on jQuery: WebUploader relies on the jQuery library, which may be a drawback for developers who prefer to use a more lightweight or modern JavaScript framework.
  • Limited Documentation: While the library is well-documented, the documentation could be more comprehensive, especially for more advanced use cases.
  • Potential Performance Issues: Depending on the size and number of files being uploaded, WebUploader may experience performance issues, especially on older or less powerful devices.
  • Lack of Native File Handling: WebUploader relies on the browser's built-in file handling capabilities, which may not always provide the level of control or customization that some developers require.

Code Examples

Here are a few examples of how to use WebUploader in your web application:

  1. Basic File Upload:
var uploader = WebUploader.create({
    // Required: Set the file upload target URL.
    server: 'http://example.com/upload',
    // Required: Select the file input element.
    pick: '#filePicker'
});

// Listen for the 'uploadSuccess' event and handle the response.
uploader.on('uploadSuccess', function(file, response) {
    console.log('File uploaded successfully:', response);
});
  1. Handling Multiple File Uploads:
var uploader = WebUploader.create({
    // Required: Set the file upload target URL.
    server: 'http://example.com/upload',
    // Required: Select the file input element.
    pick: '#filePicker',
    // Enable multiple file selection.
    multiple: true
});

// Listen for the 'uploadProgress' event and update the UI.
uploader.on('uploadProgress', function(file, percentage) {
    console.log('Upload progress for file:', file.name, percentage * 100 + '%');
});
  1. Customizing the UI:
var uploader = WebUploader.create({
    // Required: Set the file upload target URL.
    server: 'http://example.com/upload',
    // Required: Select the file input element.
    pick: {
        id: '#filePicker',
        // Customize the file picker button.
        label: 'Select Files'
    },
    // Customize the upload button.
    formData: {
        uid: 123
    }
});
  1. Handling Errors and Retries:
var uploader = WebUploader.create({
    // Required: Set the file upload target URL.
    server: 'http://example.com/upload',
    // Required: Select the file input element.
    pick: '#filePicker',
    // Enable automatic retries on failure.
    auto: true,
    // Set the maximum number of retries.
    chunkRetry: 3
});

// Listen for the 'uploadError' event and handle the error.
uploader.on('uploadError', function(file, reason) {
    console.error('Error uploading file:', file.name, reason);
});

Getting Started

To get started with WebUploader, follow these steps:

  1. Include the WebUploader CSS and JavaScript files in your HTML:

Competitor Comparisons

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

Pros of jQuery-File-Upload

  • More mature and widely adopted project with a larger community
  • Extensive documentation and examples available
  • Supports a wider range of browsers, including older versions

Cons of jQuery-File-Upload

  • Heavier dependency on jQuery, which may not be ideal for modern projects
  • Less focus on mobile-specific features compared to WebUploader

Code Comparison

WebUploader:

var uploader = WebUploader.create({
    pick: '#filePicker',
    server: '/upload.php'
});
uploader.on('fileQueued', function(file) {
    // File added to queue
});

jQuery-File-Upload:

$('#fileupload').fileupload({
    url: '/upload.php',
    done: function (e, data) {
        // File upload completed
    }
});

Both libraries offer similar functionality for file uploading, but WebUploader provides a more modern API structure. jQuery-File-Upload relies more heavily on jQuery conventions and callbacks.

WebUploader focuses on providing a flexible and customizable upload solution with better support for mobile devices and modern web applications. It offers features like chunked uploads and a more streamlined API.

jQuery-File-Upload, being an older and more established project, has broader browser support and a larger ecosystem of plugins and extensions. It's well-suited for projects that already use jQuery and require compatibility with older browsers.

28,920

The next open source file uploader for web browsers :dog:

Pros of Uppy

  • More active development with frequent updates and releases
  • Extensive plugin ecosystem for added functionality
  • Better support for modern browsers and frameworks

Cons of Uppy

  • Larger file size and potentially higher resource usage
  • Steeper learning curve due to more complex architecture

Code Comparison

WebUploader:

var uploader = WebUploader.create({
    pick: '#filePicker',
    server: '/upload.php'
});
uploader.on('fileQueued', function(file) {
    // File added to queue
});

Uppy:

const uppy = new Uppy()
  .use(Dashboard, { trigger: '#select-files' })
  .use(XHRUpload, { endpoint: '/upload' })

uppy.on('file-added', (file) => {
  // File added to Uppy
})

Key Differences

  • Uppy offers a more modular approach with plugins
  • WebUploader has a simpler API but less flexibility
  • Uppy provides a more modern and customizable UI out of the box

Community and Ecosystem

  • Uppy has a larger and more active community
  • More third-party integrations available for Uppy
  • WebUploader has better documentation in Chinese

Performance

  • WebUploader may have slightly better performance for basic use cases
  • Uppy offers better handling of large files and concurrent uploads

Multiple file upload plugin with image previews, drag and drop, progress bars. S3 and Azure support, image scaling, form support, chunking, resume, pause, and tons of other features.

Pros of Fine Uploader

  • More comprehensive documentation and examples
  • Wider browser support, including older versions
  • Offers both jQuery and non-jQuery versions

Cons of Fine Uploader

  • Larger file size and potentially heavier resource usage
  • Less focus on modern, mobile-friendly interfaces

Code Comparison

Fine Uploader:

var uploader = new qq.FineUploader({
    element: document.getElementById('uploader'),
    request: {
        endpoint: '/server/upload'
    }
});

WebUploader:

var uploader = WebUploader.create({
    pick: '#picker',
    server: '/server/upload'
});

Additional Notes

Both Fine Uploader and WebUploader are file upload libraries for web applications. Fine Uploader offers more features and broader compatibility, making it suitable for complex projects with diverse browser support requirements. WebUploader, developed by Baidu's FEX team, is more lightweight and focuses on modern web standards, making it a good choice for projects targeting newer browsers and mobile devices.

Fine Uploader has a larger community and more frequent updates, while WebUploader has strong support in the Chinese developer community. The choice between the two depends on specific project requirements, target audience, and desired features.

2,959

A JavaScript library providing multiple simultaneous, stable, fault-tolerant and resumable/restartable file uploads via the HTML5 File API.

Pros of flow.js

  • Lightweight and focused on chunk-based file uploads
  • Better cross-browser compatibility, including older browsers
  • More active development and community support

Cons of flow.js

  • Less feature-rich compared to WebUploader
  • Requires more custom implementation for advanced features
  • Limited built-in UI components

Code Comparison

WebUploader:

var uploader = WebUploader.create({
    pick: '#filePicker',
    server: '/upload.php'
});
uploader.on('fileQueued', function(file) {
    // File added to queue
});

flow.js:

var flow = new Flow({
    target: '/upload.php',
    chunkSize: 1024 * 1024
});
flow.assignBrowse(document.getElementById('filePicker'));
flow.on('fileAdded', function(file, event) {
    // File added to queue
});

Both libraries provide similar functionality for file uploads, but WebUploader offers more built-in features and UI components out of the box. flow.js focuses on core chunked upload functionality, allowing for more customization but requiring additional implementation for advanced features. WebUploader has a more comprehensive API, while flow.js is lighter and more flexible for specific use cases.

18,054

Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.

Pros of Dropzone

  • More active development and maintenance
  • Extensive documentation and examples
  • Wider browser compatibility, including mobile support

Cons of Dropzone

  • Larger file size (~ 50KB minified)
  • Less customizable UI out of the box
  • Limited built-in features compared to WebUploader

Code Comparison

WebUploader:

var uploader = WebUploader.create({
    pick: '#filePicker',
    server: '/upload.php'
});
uploader.on('fileQueued', function(file) {
    // File added to queue
});

Dropzone:

Dropzone.options.myDropzone = {
    url: "/upload.php",
    init: function() {
        this.on("addedfile", function(file) {
            // File added to dropzone
        });
    }
};

Both libraries provide easy-to-use APIs for file uploading, but WebUploader offers more granular control over the upload process, while Dropzone focuses on simplicity and ease of integration. WebUploader's chunk upload feature is more advanced, making it suitable for large file uploads. Dropzone's drag-and-drop interface is more polished out of the box, requiring less customization for a modern look and feel.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

不再对使用问题进行答复,如果有希望的功能改进或者bugfix可以提交PR

WebUploader 文件上传 Build Status Built with Grunt

WebUploader是一个简单的以HTML5为主,FLASH为辅的现代文件上传组件。在现代的浏览器里面能充分发挥HTML5的优势,同时又不摒弃主流IE浏览器,延用原来的FLASH运行时,兼容IE6+,Andorid 4+,IOS 6+。两套运行时,同样的调用方式,可供用户任意选用。

支持大文件分片并发上传,极大的提高了文件上传效率。

支持

代码肯定存在很多不足和需要优化的地方,欢迎大家提交 pr。感谢以下代码贡献者, 排名不分先后。

@zensh,@ushelp,@duanlixin。

特性

分片、并发

分片与并发结合,将一个大文件分割成多块,并发上传,极大地提高大文件的上传速度。

当网络问题导致传输错误时,只需要重传出错分片,而不是整个文件。另外分片传输能够更加实时的跟踪上传进度。

预览、压缩

支持常用图片格式jpg,jpeg,gif,bmp,png预览与压缩,节省网络数据传输。

解析jpeg中的meta信息,对于各种orientation做了正确的处理,同时压缩后上传保留图片的所有原始meta数据。

多途径添加文件

支持文件多选,类型过滤,拖拽(文件&文件夹),图片粘贴功能。

粘贴功能主要体现在当有图片数据在剪切板中时(截屏工具如QQ(Ctrl + ALT + A), 网页中右击图片点击复制),Ctrl + V便可添加此图片文件。

HTML5 & FLASH

兼容主流浏览器,接口一致,实现了两套运行时支持,用户无需关心内部用了什么内核。

同时Flash部分没有做任何UI相关的工作,方便不关心flash的用户扩展和自定义业务需求。

MD5秒传

当文件体积大、量比较多时,支持上传前做文件md5值验证,一致则可直接跳过。

如果服务端与前端统一修改算法,取段md5,可大大提升验证性能,耗时在20ms左右。

易扩展、可拆分

采用可拆分机制, 将各个功能独立成了小组件,可自由搭配。

采用AMD规范组织代码,清晰明了,方便高级玩家扩展。

NPM DownloadsLast 30 Days