UNPKG

7.37 kBMarkdownView Raw
1# <img src="https://github.com/pqina/filepond-github-assets/blob/master/logo.svg" height="44" alt="FilePond"/>
2
3A JavaScript library that can upload anything you throw at it, optimizes images for faster uploads, and offers a great, accessible, silky smooth user experience.
4
5[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/pqina/filepond/blob/master/LICENSE)
6[![npm version](https://badge.fury.io/js/filepond.svg)](https://www.npmjs.com/package/filepond)
7[![Support on Patreon](https://img.shields.io/badge/support-patreon-salmon.svg)](https://www.patreon.com/rikschennink)
8
921 KB gzipped. FilePond adapters are available for **[React](https://github.com/pqina/react-filepond)**, **[Vue](https://github.com/pqina/vue-filepond)**, **[Angular](https://github.com/pqina/ngx-filepond)** and **[jQuery](https://github.com/pqina/jquery-filepond)**
10
11FilePond is maintained by **[Rik Schennink](https://twitter.com/rikschennink/)**
12
13<img src="https://github.com/pqina/filepond-github-assets/blob/master/filepond-animation-01.gif?raw=true" width="370" alt=""/>
14
15### Core Features
16
17* Accepts **directories**, **files**, blobs, local URLs, **remote URLs** and Data URIs.
18* **Drop files**, select on filesystem, **copy and paste files**, or add files using the API.
19* **Async uploading** with AJAX, or encode files as base64 data and send along form post.
20* **Accessible**, tested with AT software like VoiceOver and JAWS, **navigable by Keyboard**.
21* **Image optimization**, automatic image resizing, **cropping**, and **fixes EXIF orientation**.
22* **Responsive**, automatically scales to available space, is functional on both **mobile and desktop devices**.
23
24[Learn more about FilePond](https://pqina.nl/filepond/)
25
26
27### Looking for a great Image Editor?
28
29**Doka.js** might be just what you're looking for. It's a Modern JavaScript Image Editor, Doka supports setting **crop aspect ratios**, **resizing**, **rotating**, **cropping**, and **flipping** images. Above all, it integrates beautifully with FilePond.
30
31[Learn more about Doka](https://pqina.nl/doka/)
32
33
34### Plugins
35
36* [File encode](https://github.com/pqina/filepond-plugin-file-encode)
37* [File rename](https://github.com/pqina/filepond-plugin-file-rename)
38* [File size validation](https://github.com/pqina/filepond-plugin-file-validate-size)
39* [File type validation](https://github.com/pqina/filepond-plugin-file-validate-type)
40* [File metadata](https://github.com/pqina/filepond-plugin-file-metadata)
41* [File poster](https://github.com/pqina/filepond-plugin-file-poster)
42* [Image editor](https://github.com/pqina/filepond-plugin-image-edit)
43* [Image size validation](https://github.com/pqina/filepond-plugin-image-validate-size)
44* [Image preview](https://github.com/pqina/filepond-plugin-image-preview)
45* [Image crop](https://github.com/pqina/filepond-plugin-image-crop)
46* [Image resize](https://github.com/pqina/filepond-plugin-image-resize)
47* [Image transform](https://github.com/pqina/filepond-plugin-image-transform)
48* [Image EXIF orientation](https://github.com/pqina/filepond-plugin-image-exif-orientation)
49
50
51### Adapters
52
53* [React](https://github.com/pqina/react-filepond)
54* [Vue](https://github.com/pqina/vue-filepond)
55* [jQuery](https://github.com/pqina/jquery-filepond)
56* [Angular](https://github.com/pqina/ngx-filepond)
57* [Angular 1](https://github.com/johnnyasantoss/angularjs-filepond)
58* [Ember](https://github.com/alexdiliberto/ember-filepond)
59
60
61### Backend
62
63* [PHP](https://github.com/pqina/filepond-boilerplate-php)
64* [Django](https://github.com/ImperialCollegeLondon/django-drf-filepond)
65* [Laravel](https://github.com/Sopamo/laravel-filepond)
66
67
68## Quick Start
69
70Install using npm:
71
72```bash
73npm install filepond
74```
75
76Then import in your project:
77
78```js
79import * as FilePond from 'filepond';
80
81// Create a multi file upload component
82const pond = FilePond.create({
83 multiple: true,
84 name: 'filepond'
85});
86
87// Add it to the DOM
88document.body.appendChild(pond.element);
89```
90
91Or get it from a CDN:
92
93```html
94<!DOCTYPE html>
95<html>
96<head>
97 <title>FilePond from CDN</title>
98
99 <!-- Filepond stylesheet -->
100 <link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet">
101
102</head>
103<body>
104
105 <!-- We'll transform this input into a pond -->
106 <input type="file" class="filepond">
107
108 <!-- Load FilePond library -->
109 <script src="https://unpkg.com/filepond/dist/filepond.js"></script>
110
111 <!-- Turn all file input elements into ponds -->
112 <script>
113 FilePond.parse(document.body);
114 </script>
115
116</body>
117</html>
118```
119
120[Getting started with FilePond](https://pqina.nl/filepond/docs/patterns/getting-started/)
121
122
123## Contributing
124
125At 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.
126
127Tests are based on Jest and can be run with `npm run test`
128
129To build the library run `npm run build`
130
131
132## Publications
133
134* [Smooth file uploading with React and FilePond](https://itnext.io/uploading-files-with-react-and-filepond-f8a798308557)
135* [5 interesting technical challenges I faced while building FilePond](https://itnext.io/filepond-frontend-trickery-a3073c934c77)
136* [Image uploads with Laravel and FilePond](https://devdojo.com/episode/image-uploads-with-laravel-and-filepond)
137* [Integrating FilePond with Ember](https://alexdiliberto.com/ember-filepond/latest/)
138* [FilePond launch day post-mortem](https://pqina.nl/blog/filepond-launch-day-post-mortem)
139* [FilePond on ProductHunt](https://www.producthunt.com/posts/filepond-js)
140
141
142### Browser Compatibility
143
144FilePond 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](https://github.com/pqina/filepond-polyfill) and [Babel polyfill](https://babeljs.io/docs/en/babel-polyfill) to your project.
145
146FilePond uses [BrowserStack](https://www.browserstack.com/) for compatibility testing.
147
148[<img src="https://github.com/pqina/filepond-github-assets/blob/master/browserstack-logo.svg" height="32" alt="BrowserStack"/>](https://www.browserstack.com/)
149
150## License
151
152**Please don't remove or change the disclaimers in the source files**
153
154MIT License
155
156Copyright (c) 2019 PQINA | [Rik Schennink](mailto:rik@pqina.nl)
157
158Permission is hereby granted, free of charge, to any person obtaining a copy
159of this software and associated documentation files (the "Software"), to deal
160in the Software without restriction, including without limitation the rights
161to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
162copies of the Software, and to permit persons to whom the Software is
163furnished to do so, subject to the following conditions:
164
165The above copyright notice and this permission notice shall be included in all
166copies or substantial portions of the Software.
167
168THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
169IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
170FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
171AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
172LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
173OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
174SOFTWARE.