filepond

pqinaMIT活跃维护

一个灵活好玩的 JavaScript 文件上传库,支持拖拽上传、图片处理和插件扩展,帮前端开发者快速搭出体验顺滑的上传组件。

🌊 A flexible and fun JavaScript file upload library

4.28.2发布于 2021-06-09 08:45 UTC16,396star +2 / 7 天851fork同步于 2026-11-10 23:27 UTC

怎么上手

由 README 提炼,执行前请确认
npm install filepond
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

一个灵活好用的 JavaScript 文件上传库,帮你把拖拽、粘贴、异步分块上传和图片优化一次搞定

一个灵活好玩的 JavaScript 文件上传库,支持拖拽上传、图片处理和插件扩展,帮前端开发者快速搭出体验顺滑的上传组件。

核心能力

  • 接受目录、文件、Blob、本地与远程 URL 及 Data URI
  • 支持拖拽、文件选择、复制粘贴和 API 添加文件
  • AJAX 异步上传,支持分块上传与 base64 编码随表单提交
  • 自动缩放、裁剪、过滤图片并修正 EXIF 方向
  • 键盘可导航,经 VoiceOver 和 JAWS 等辅助技术测试

容易踩的坑

图片预览、裁剪、缩放、EXIF 修正等能力需额外安装对应插件;需自行引入 filepond.css 样式表,否则组件无样式;旧浏览器需额外引入 FilePond Polyfill 和 Babel polyfill

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本4.28.2
  1. 4.28.2最新正式版2021-06-09 · 2021-06-09 08:45 UTC
    • Fix issue where local server files could not be re-uploaded after editing and did not trigger remove of source file.
  2. 4.28.12021-06-09 · 2021-06-09 08:45 UTC
    查看更新说明
    • Fix CSS error.
  3. 4.28.02021-06-09 · 2021-06-09 08:45 UTC
    查看更新说明
    • Add storeAsFile property, if set to true FilePond will attempt to store the file objects in file input elements allowing file submit along with parent form (no need for server property). This only works if the browser supports the DataTransfer constructor, this is the case on Firefox, Chrome, Chromium powered browsers and Safari version 14.1 and higher.
    • Switch to PostCSS for style output.
  4. 4.27.32021-05-31 · 2021-05-31 07:15 UTC
    查看更新说明
    • Fix issue with file.js component leaking state causing allowRemove to impact other instances of FilePond. #713
  5. 4.27.22021-05-27 · 2021-05-27 10:55 UTC
    查看更新说明
    • Fix issue with fetch and HEAD no setting server id to hidden input element.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    A JavaScript library that can upload anything you throw at it, optimizes images for faster uploads, and offers a great, accessible, silky smooth user experience.

    License: MIT npm version npm minzipped size Discord

    FilePond adapters are available for React, Vue, Angular, Svelte, and jQuery

    FilePond v5 Alpha version now available for testing

    Documentation • Discord • Examples


    Buy me a Coffee • Use FilePond with Pintura • Dev updates


    Core Features

    • Accepts directories, files, blobs, local URLs, remote URLs and Data URIs.
    • Drop files, select on filesystem, copy and paste files, or add files using the API.
    • Async uploads with AJAX, supports chunk uploads, can encode files as base64 data and send along form post.
    • Accessible, tested with AT software like VoiceOver and JAWS, navigable by Keyboard.
    • Image optimization, automatic image resizing, cropping, filtering, and fixes EXIF orientation.
    • Responsive, automatically scales to available space, is functional on both mobile and desktop devices.

    Learn more about FilePond


    Also need Image Editing?

    Pintura the modern JavaScript Image Editor is what you're looking for. Pintura supports setting crop aspect ratios, resizing, rotating, cropping, and flipping images. Above all, it integrates beautifully with FilePond.

    Learn more about Pintura


    Live Demos

    Plugins

    Adapters

    Backend

    Quick Start

    Install using npm:

    npm install filepond
    

    Then import in your project:

    import * as FilePond from 'filepond';
    
    // Create a multi file upload component
    const pond = FilePond.create({
        multiple: true,
        name: 'filepond',
    });
    
    // Add it to the DOM
    document.body.appendChild(pond.element);
    

    Or get it from a CDN:

    <!DOCTYPE html>
    <html>
        <head>
            <title>FilePond from CDN</title>
    
            <!-- Filepond stylesheet -->
            <link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet" />
        </head>
        <body>
            <!-- We'll transform this input into a pond -->
            <input type="file" class="filepond" />
    
            <!-- Load FilePond library -->
            <script src="https://unpkg.com/filepond/dist/filepond.js"></script>
    
            <!-- Turn all file input elements into ponds -->
            <script>
                FilePond.parse(document.body);
            </script>
        </body>
    </html>
    

    Getting started with FilePond

    Internationalization

    The locale folder contains different language files, PR's are welcome, you can use locale files like this:

    import pt_BR from 'filepond/locale/pt-br.js';
    
    FilePond.setOptions(pt_BR);
    

    Contributing

    At the moment test coverage is not great, it's around 65%. To accept pull requests the tests need to be better, any help to improve them is very much appreciated.

    Tests are based on Jest and can be run with npm run test

    To build the library run npm run build

    Publications

    Browser Compatibility

    FilePond is compatible with a wide range of desktop and mobile browsers, the oldest explicitly supported browser is IE11, for best cross browser support add FilePond Polyfill and Babel polyfill to your project.

    FilePond uses BrowserStack for compatibility testing.

    License

    Please don't remove or change the disclaimers in the source files

    MIT License

    Copyright (c) 2020 PQINA | Rik Schennink

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.