Filepond

A flexible and fun JavaScript file upload library

README

# [FilePond](https://pqina.nl/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

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


[FilePond](https://www.buymeacoffee.com/rikschennink/)



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.


[](https://pqina.nl/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.


[](https://pqina.nl/pintura/?ref=github-filepond)


FilePond Plugins




Adapters


  React
  Vue
  Svelte
  jQuery


Backend


  PHP

Quick Start


Install using npm:

  1. ``` sh
  2. npm install filepond
  3. ```

Then import in your project:

  1. ``` js
  2. import * as FilePond from 'filepond';

  3. // Create a multi file upload component
  4. const pond = FilePond.create({
  5.     multiple: true,
  6.     name: 'filepond'
  7. });

  8. // Add it to the DOM
  9. document.body.appendChild(pond.element);
  10. ```

Or get it from a CDN:

  1. ``` html
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5.   <title>FilePond from CDN</title>
  6. <link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet">
  7. </head>
  8. <body>
  9. <input type="file" class="filepond">
  10. <script src="https://unpkg.com/filepond/dist/filepond.js"></script>
  11. <script>
  12.   FilePond.parse(document.body);
  13.   </script>
  14. </body>
  15. </html>
  16. ```



Internationalization


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

  1. ``` js
  2. import pt_BR from 'filepond/locale/pt-br.js';

  3. FilePond.setOptions(pt_BR);
  4. ```


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](https://www.browserstack.com/)


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.