filepond README

The project's README from github.com/pqina/filepond. As one markdown file: README.md.

FilePond

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


FilePond

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


Core Features

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.

BrowserStack

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.

filepond (pqina/filepond)

Searching Database…

16.4K ·GitHub
这是什么?FilePond 是一个 JavaScript 文件上传库,支持拖放、选择文件和异步上传,并会自动优化图片(调整尺寸、裁剪、应用滤镜、修复 EXIF 方向),让上传体验更流畅、更易用。
它是独立的库,还是需要依赖某个框架?它的核心是原生 JavaScript 库,同时提供官方适配器,可用于 React、Vue、Angular、Svelte 和 jQuery 项目。
我该如何把它添加到项目中?可以用 npm 安装并在代码中导入,也可以直接通过 CDN 的 script 标签引入。
接收上传文件需要特定的后端吗?不需要特定的后端,但社区维护了现成的服务端集成方案,支持 PHP、Django、Laravel、SilverStripe 和 Ruby on Rails,用于处理上传接口。
FilePond 目前的稳定性和测试覆盖情况如何?据维护者自己说,测试覆盖率只有约 65%。如果需要支持 IE11 或其他旧版浏览器,你必须自行添加单独的 FilePond Polyfill 和 Babel polyfill。
FilePond 会自动对图片做哪些处理?在上传前,它会自动调整图片尺寸、裁剪、应用滤镜,并即时修复 EXIF 方向,因此无需额外代码,图片就能以优化后的状态上传。
上传前能编辑图片吗,比如裁剪或旋转?FilePond 本身专注于上传体验,但它可以与作者的另一个 JavaScript 图片编辑器 Pintura 集成,从而添加裁剪、旋转、调整尺寸和翻转等工具。
有哪些插件可以扩展 FilePond 的功能?官方插件包括文件编码、重命名、文件大小和类型校验、元数据、视频封面图,以及图片预览、裁剪、调整尺寸、滤镜和变换;社区还提供若干插件,如 PDF 预览和 zip 上传等。
文件究竟是如何发送到服务器的?FilePond 通过 AJAX 异步上传,支持对大文件进行分块上传,也可以将文件编码为 base64,或随普通表单提交一同发送。
Creator
pqina
Size
8.8 MB
Stars
16.4K
Age
9y
Commits · 90 Days