PHPackages                             lekoala/silverstripe-filepond - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. lekoala/silverstripe-filepond

ActiveSilverstripe-vendormodule[File &amp; Storage](/categories/file-storage)

lekoala/silverstripe-filepond
=============================

Use FilePond fields in SilverStripe

2.0.0(7mo ago)814.4k↓49%5[1 issues](https://github.com/lekoala/silverstripe-filepond/issues)2MITPHPPHP ^8.3

Since May 19Pushed 7mo ago4 watchersCompare

[ Source](https://github.com/lekoala/silverstripe-filepond)[ Packagist](https://packagist.org/packages/lekoala/silverstripe-filepond)[ GitHub Sponsors](https://github.com/lekoala)[ RSS](/packages/lekoala-silverstripe-filepond/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (18)Used By (2)

SilverStripe FilePond module
============================

[](#silverstripe-filepond-module)

[![Build Status](https://github.com/lekoala/silverstripe-filepond/actions/workflows/ci.yml/badge.svg)](https://github.com/lekoala/silverstripe-filepond/actions/workflows/ci.yml/badge.svg)[![scrutinizer](https://camo.githubusercontent.com/f6e8ff38ef2caa8ccfc6198c86bf78dc67da1db2b1d2a25991d92f342aaa7038/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c656b6f616c612f73696c7665727374726970652d66696c65706f6e642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/lekoala/silverstripe-filepond/)[![Code coverage](https://camo.githubusercontent.com/371837c7d6a415404a27564e60384a54a70e010f011f86e37018a3ddeee47e53/68747470733a2f2f636f6465636f762e696f2f67682f6c656b6f616c612f73696c7665727374726970652d66696c65706f6e642f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/lekoala/silverstripe-filepond)

Intro
-----

[](#intro)

Allow usage of [FilePond](https://pqina.nl/filepond/) fields in the front end.

Use as a regular UploadField and let it do its magic!

```
$pond = new FilePondField('Image');
```

File extension
--------------

[](#file-extension)

In order for this uploader to work properly, your files need to have a IsTemporary boolean field. This is provided by the FilePondFileExtension class.

```
SilverStripe\Assets\File:
  extensions:
    - LeKoala\FilePond\FilePondFileExtension
LeKoala\FilePond\FilePondField:
  enable_auto_thumbnails: true
```

You can of course implement your own extension. As a bonus, you can toggle the `enable_auto_thumbnails`to `true` in order to get thumbnails for images in the cms.

Temporary files
---------------

[](#temporary-files)

Because files are upload in ajax, maybe they will never be used if the user never submit the form.

In order to avoid storing unecessary files, all files uploaded are flagged by default as `IsTemporary`.

All files are then unflagged as `IsTemporary` when the form is submitted and saved into a record.

Although this should all work automatically, if you manually use the FilePondField without saving into a record you need to manually unflag the files yourself.

By default, old temporary files are deleted automatically by the FilePondField::clearTemporaryUploads method. You can control how often files are deleted based on your upload frequencies (see `auto_clear_threshold`). Since the files are deleted on upload, it might take some time if you have a lot of files to delete. This is disabled by default and you need to enable it with `auto_clear_temp_folder` set to `true`

If that's the case, maybe it's better to run a cron task every 5 minutes that calls this method in order to avoid burdening the end user. Have a look at my [simple jobs module](https://github.com/lekoala/silverstripe-simple-jobs) to do that.

Tracking files
--------------

[](#tracking-files)

Most of the time, uploaded files are linked to a record. The primary mechanism of moving uploaded files out of the `IsTemporary` state is done through the `FilePondField::saveInto` method.

In order to maximize tracking, the `FilePondFileExtension` also add `ObjectID` and `ObjectClass` fields to the `File` table.

This allows to associate files easily to your `DataObject` classes without adding specific `has_many` or `many_many` relations, which either create extra tables or required reciprocal relationships.

Instead, while moving files out of `IsTemporary` state, we also associate the current form record to the file.

Configuring field instances
---------------------------

[](#configuring-field-instances)

This module configure FilePondFields based on a config data attribute. It will generate most of the config by itself, however you can customize frontend behaviour with the following method:

```
$pond->addFilePondConfig('allowDrop', false);
```

Please refer to FilePond documentation to see what are the public properties.

Poster images
-------------

[](#poster-images)

You can enable dedicated plugins

```
LeKoala\FilePond\FilePondField:
  enable_image: true
  enable_poster: true
  enable_auto_thumbnails: true
```

These modules enable poster support to display nices images attached to the upload field

[![poster](docs/poster-example.jpg "poster")](docs/poster-example.jpg)

Validation, resizing and croping
--------------------------------

[](#validation-resizing-and-croping)

### For files

[](#for-files)

By default, this module validate file size and file extension in the front end thanks to the FilePond plugins.

You can read more here:

### For images

[](#for-images)

We also installed the image size validation, resize and crop plugins. This allows to avoid user uploading incorrect format that might be difficult to crop or resize (GD crashing anyone?).

You can define custom image sizes on your records based on convention. For example, for a squared avatar and a large image.

```
MyRecord:
  image_sizes:
    Avatar: [512,512,'max']
    SquareImage: [512,512,'crop']
    LargeImage: [1080,1080]
```

Parameters are width, height. You can set a 3rd parameter to:

- 'min' to ensure the file is above this size (default if no value is specified).
- 'max' to ensure the file is below this size.
- 'crop' to crop the file to this ratio (keep the largest image possible matching this ratio).
    - Example : Setting 512,512 means a squared ratio (effectively, this is 1:1)
- 'resize' resize the file to this size (keeps aspect ratio of the file).
- 'crop\_resize' crop and resize the file to this size (use our set aspect ratio).

Image manipulations happen on the client side, the file that gets sent to the server will have the configured size. Very useful to deal with large images or avoiding scaling files after upload.

If defined, the field description and the validation will be automatically applied.

You can also use the `setImageSize` method directly on the uploader instance with similar parameters.

```
$fields->replaceField("Photo", $Photo = new FilePondField("Photo"));
$Photo->setImageSize(300, 200, 'crop');
```

You can read more here:

Renaming and organizing files
-----------------------------

[](#renaming-and-organizing-files)

One thing is certain, your user tends to name files incorrectly. The end result is that your asset folder is full of stuff with crazy names.

In order to bring some sanity to your asset folder, this module work in two ways.

### Default folder

[](#default-folder)

The default behaviour from SilverStripe is to upload everything in the Uploads folder. But wouldn't it be more useful to organize things based on your class ? Project files go to Project folder. Sounds good?

Great, because this is exactly how it works.

By default, if a record is associated to the form, all files will be uploaded to NameOfTheClass/NameOfTheUploader.

This behaviour is fully configurable. If your `DataObject` implements a `getFolderName` method, you can retain paths based on your own logic (for example NameOfTheClass/IDOfTheRecord). By default, I don't recommend to store files based on records IDs because : 1. IDs are not known for new records, 2. If you have lots of records, you will have lots of folders that are slow to parse and display.

### Renaming files according to a pattern

[](#renaming-files-according-to-a-pattern)

Let's say your users can upload avatars. But it wouldn't be too good to allow crazy names in a public facing website right?

Don't worry, I'm here to help:

```
$pond = new FilePondField('Avatar');
$pond->setRenamePattern("{field}_{date}.{extension}");
```

By setting a rename pattern, you can rename dynamically the files *before they are saved to the asset store* (which is really great).

The following pattern will rename the file to Avatar\_yyyymmdd.jpg. You can also set static parts, for example:

```
$pond = new FilePondField('Avatar');
$pond->setRenamePattern($member->Username . "_avatar.{extension}");
```

You can also use the built-in Filepond renamer like this. Files will be renamed in the frontend before being upload to the server:

```
$pond = new FilePondField('Avatar');
$pond->setRenameFile('my_avatar_' . time());
```

Chunked uploads
---------------

[](#chunked-uploads)

If you need to upload large videos, you can use `setChunkUploads`. File will be uploaded in chunks (size is computed automatically based on server settings) and then merged on the last upload.

```
$fields->push($Video = new FilePondField("Video"));
$Video->setChunkUploads(true);
```

You can also enable this globally with `chunk_by_default`.

Requirements
------------

[](#requirements)

In order to provide a working out of the box experience, Filepond is provided as a custom element imported from

Custom server config
--------------------

[](#custom-server-config)

If for some reason you use a custom endpoint for your FilePond, you can use the `setCustomServerConfig`. You can pass an array of options (for simple configs) or a string that should be the name of a global js handler.

Config flags
------------

[](#config-flags)

FilePondField has the following configurable options

```
LeKoala\FilePond\FilePondField:
  auto_clear_temp_folder: true
  auto_clear_threshold: null #defaults to 1 day in prod env
  enable_default_description: true
  enable_requirements: true
  enable_poster: false
  chunk_by_default: false
  enable_auto_thumbnails: true
  poster_width: 352
  poster_height: 264
```

Todo
----

[](#todo)

- More tests and refactoring

Sponsored by
------------

[](#sponsored-by)

This module is kindly sponsored by [RESTRUCT](restruct.nl)

Compatibility
-------------

[](#compatibility)

Tested with ^6

For v4/v5, use previous branch

Maintainer
----------

[](#maintainer)

LeKoala -

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance60

Regular maintenance activity

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 98.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~99 days

Recently: every ~2 days

Total

17

Last Release

235d ago

Major Versions

1.x-dev → 2.0.02025-09-26

PHP version history (4 changes)1.0.0PHP &gt;=7.2

1.4.0PHP ^7.4 || ^8.0

1.4.2PHP ^7.4 || ^8

2.0.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/250762?v=4)[Thomas Portelange](/maintainers/lekoala)[@lekoala](https://github.com/lekoala)

---

Top Contributors

[![lekoala](https://avatars.githubusercontent.com/u/250762?v=4)](https://github.com/lekoala "lekoala (92 commits)")[![bimthebam](https://avatars.githubusercontent.com/u/3392650?v=4)](https://github.com/bimthebam "bimthebam (1 commits)")

---

Tags

filepondsilverstripesilverstripe-moduleuploaduploadersilverstripecmsuploadmoduleformfilepond

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/lekoala-silverstripe-filepond/health.svg)

```
[![Health](https://phpackages.com/badges/lekoala-silverstripe-filepond/health.svg)](https://phpackages.com/packages/lekoala-silverstripe-filepond)
```

###  Alternatives

[silverstripe/cms

The SilverStripe Content Management System

5163.4M1.3k](/packages/silverstripe-cms)[unclecheese/dropzone

An HTML5 upload field for the CMS and frontend forms.

46130.7k6](/packages/unclecheese-dropzone)[lekoala/silverstripe-cms-actions

Add actions to your models in SilverStripe

39279.9k22](/packages/lekoala-silverstripe-cms-actions)[axllent/silverstripe-image-optimiser

Automatically optimise all uploaded &amp; resampled images in Silverstripe

1118.4k2](/packages/axllent-silverstripe-image-optimiser)[unclecheese/kickassets

Provides an alternative file management interface for SilverStripe CMS with drag-and-drop, multi-selection, and several other desktop-like UI conventions.

464.0k](/packages/unclecheese-kickassets)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
