cakephp-file-storage 0,0 editorconfig scrutinizer travis-ci Packagist phpunit

Abstract file storage and upload plugin for CakePHP. Write to local disk, FTP, S3, Dropbox and more through a single interface. It's not just yet another uploader but a complete storage solution.

FileStorage Plugin for CakePHP

Software License Build Status Coverage Status Code Quality

If you’re upgrading from CakePHP 2.x please read the migration guide.

The File Storage plugin is giving you the possibility to upload and store files in virtually any kind of storage backend. This plugin is wrapping the Gaufrette library in a CakePHP fashion and provides a simple way to use the storage adapters through the StorageManager class.

Storage adapters are an unified interface that allow you to store file data to your local file system, in memory, in a database or into a zip file and remote systems. There is a database table keeping track of what you stored where. You can always write your own adapter or extend and overload existing ones.

Please donate if you like it!

Already thought of how many hours development time this plugin saved you already? It would be awesome if you don’t mind sharing some of your success by donating a small amount! Thank you.

How it works

The whole plugin is build with clear Separation of Concerns (SoC) in mind: A file is always an entry in the file_storage table from the app perspective. The table is the reference to the real place of where the file is stored and keeps some meta information like mime type, filename, file hash (optional) and size as well. Storing the path to a file inside an arbitrary table along other data is considered as bad practice because it doesn’t respect SoC from an architecture perspective but many people do it this way for some reason.

You associate the file_storage table with your model using the FileStorage or ImageStorage model from the plugin via hasOne, hasMany or HABTM. When you upload a file you save it to the FileStorage model through the associations, Documents.file for example. The FileStorage model dispatches then file storage specific events, the listeners listening to these events process the file and put it in the configured storage backend using adapters for different backends and build the storage path using a path builder class.

List of supported Adapters

  • Apc
  • Amazon S3
  • ACL Aware Amazon S3
  • Azure
  • Doctrine DBAL
  • Dropbox
  • Ftp
  • Grid FS
  • In Memory
  • Local File System
  • MogileFS
  • Open Cloud
  • Rackspace Cloudfiles
  • Sftp
  • Zip File


  • PHP 5.4+
  • CakePHP 3.0
  • Gaufrette Library (included as composer dependency)

Optional but required for image processing:


For documentation, as well as tutorials, see the docs directory of this repository.


For bugs and feature requests, please use the issues section of this repository.


To contribute to this plugin please follow a few basic rules.


Copyright 2012 - 2016, Florian Krämer

Licensed under The MIT License Redistributions of files must retain the above copyright notice.

Related Repositories



Abstract file storage and upload plugin for CakePHP. Write to local disk, FTP, S3, Dropbox and more through a single interface. It's not just yet another uploader but a complete storage solution. ...



CakePHP 2.0 Plugin for Amazon S3 file storage ...



File Storage behavior for CakePHP ...

Top Contributors

burzum robertpustulka mcallisto steinkel choma j15e scrutinizer-auto-fixer bfncs skie BionicPimp dereuromark mhimmer stonelasley rifer andrej-griniuk GuidoHendriks clawsonm 513 renan chav170 sams thinkingmedia


package version
cakephp/cakephp ~3.4
cakephp/plugin-installer *
cakephp/migrations ~1.0
knplabs/gaufrette *
dev phpunit/phpunit <6.0
burzum/cakephp-imagine-plugin 2.*
fig-r/psr2r-sniffer dev-master


-   1.1.6 zip tar
-   1.1.5 zip tar
-   1.1.4 zip tar
-   1.1.3 zip tar
-   1.1.2 zip tar
-   1.1.1 zip tar
-   1.1.0 zip tar
-   1.1.0-rc1 zip tar
-   1.1.0-beta1 zip tar
-   1.1.0-alpha1 zip tar
-   1.0.3 zip tar
-   1.0.2 zip tar
-   1.0.1 zip tar
-   1.0.0 zip tar
-   1.0.0-RC1 zip tar
-   0.5.2 zip tar
-   0.5.1 zip tar
-   0.5.0 zip tar
-   0.4.2 zip tar
-   0.4.1 zip tar
-   0.4.0 zip tar
-   0.3.3 zip tar
-   0.3.2 zip tar
-   0.3.1 zip tar
-   0.3.0 zip tar
-   0.2.1 zip tar
-   0.2.0 zip tar
-   0.1.3 zip tar
-   0.1.2 zip tar
-   0.1.1 zip tar