{"id":15412201,"url":"https://github.com/maymeow/cakephp-fileupload","last_synced_at":"2026-02-28T05:02:27.412Z","repository":{"id":45285035,"uuid":"294686211","full_name":"MayMeow/cakephp-fileupload","owner":"MayMeow","description":"🆙 File Upload plugin for CakePHP. This is mirror from my dev server. Package is available on packagist and on my dev serers's composer.","archived":false,"fork":false,"pushed_at":"2023-12-26T15:44:38.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-02T01:59:37.421Z","etag":null,"topics":["cakephp-plugin","cakephp4","file-upload","hacktoberfest"],"latest_commit_sha":null,"homepage":"https://wiki.0x0.sk/en/cake-php/FileUpload","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MayMeow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"maymeow","ko_fi":"maymeow"}},"created_at":"2020-09-11T12:13:08.000Z","updated_at":"2022-04-14T07:33:15.000Z","dependencies_parsed_at":"2024-10-01T16:51:48.658Z","dependency_job_id":"e0e9e634-9319-4fa9-9257-bd5797f8fc35","html_url":"https://github.com/MayMeow/cakephp-fileupload","commit_stats":{"total_commits":30,"total_committers":3,"mean_commits":10.0,"dds":0.2666666666666667,"last_synced_commit":"7006cdc24735404cbeafd7d7b7299d0234db0f3f"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayMeow%2Fcakephp-fileupload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayMeow%2Fcakephp-fileupload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayMeow%2Fcakephp-fileupload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayMeow%2Fcakephp-fileupload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MayMeow","download_url":"https://codeload.github.com/MayMeow/cakephp-fileupload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239550248,"owners_count":19657538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cakephp-plugin","cakephp4","file-upload","hacktoberfest"],"created_at":"2024-10-01T16:51:41.504Z","updated_at":"2026-02-28T05:02:22.380Z","avatar_url":"https://github.com/MayMeow.png","language":"PHP","funding_links":["https://github.com/sponsors/maymeow","https://ko-fi.com/maymeow"],"categories":[],"sub_categories":[],"readme":"# 🆙 FileUpload plugin for CakePHP\n\n\u003e [!NOTE]\n\u003e This is readme for version 2.x. For 1.x go to [v1.1.2](https://github.com/MayMeow/cakephp-fileupload/tree/v1.1.2) release.\n\n\u003e [!CAUTION]\n\u003e :stop_sign: Breaking changes (read before use)\n\u003e \n\u003e Version 2.x is not compatibile with cakephp lower than 5.x and it is not backward compatibile with previous releases of this plugins.\n\u003e\n\u003e - S3 storage support was removed (will be added in future relases)\n\u003e - Bunny CND storage support was added\n\u003e - All components and Managers was rewritten.\n\u003e \n\u003e And supported actions are upload and download.\n\n## Installation\n\nYou can install this plugin into your CakePHP application using [composer](https://getcomposer.org).\n\nThe recommended way to install composer packages is:\n\n## 🐘 From packagist\n\n```\ncomposer require maymeow/file-upload \"^2.0.0\"\n```\n\n## Usage\n\nAdd configuration somewhere to your config files\n\n```php\n'Storage' =\u003e [\n    'defaultStorageType' =\u003e env('STORAGE_DEFAULT_STORAGE_TYPE', 'local'),\n    'local' =\u003e [\n        'managerClass' =\u003e LocalStorageManager::class,\n        'storagePath' =\u003e env('STORAGE_LOCAL_STORAGE_PATH', ROOT . DS . 'storage' . DS),\n    ],\n    'bunny' =\u003e [\n        'managerClass' =\u003e BunnyStorageManager::class,\n        'cdnDomain' =\u003e env('BUNNY_STORAGE_CDN_DOMAIN', ''), // your cnd url\n        'region' =\u003e env('BUNNY_STORAGE_REGION', ''), // region, empty is DE\n        'baseHostName' =\u003e 'storage.bunnycdn.com', // base host name not changeable\n        'storageZone' =\u003e env('BUNNY_STORAGE_ZONE', ''), // your storage zone name\n        'storageZonePath' =\u003e env('BUNNY_STORAGE_ZONE_PATH', ''), // folder in zono\n        'accessKey' =\u003e env('BUNNY_STORAGE_ACCESS_KEY', ''), // API key for write access\n    ]\n]\n```\n\nFor bunny cdn minimal configuration is to have folowing keys configured\n\n```ini\nBUNNY_STORAGE_ACCESS_KEY=\nBUNNY_STORAGE_CDN_DOMAIN=\nBUNNY_STORAGE_ZONE=\n```\n\nIf you need/want nginx to server your static files without PHP set `STORAGE_LOCAL_STORAGE_PATH` location to whe webroot folder.\n\nLoad plugin with adding\n\n```php\n$this-\u003eaddPlugin('FileUpload'); // in your Application.php bootstrap function\n```\n\nor you can add your plugin with `plugins.php` config file\n\n```php\nreturn [\n    // .. your other plugins\n    'FileUpload' =\u003e [],\n];\n```\n\nLoading components\n\n```php\n$config = Configure::read('Storage.local'); // or Storage.bunny\n\n// or by setting it with .env STORAGE_DEFAULT_STORAGE_TYPE\n$storageType = Configure::read('Storage.defaultStorageType');\n$config = Configure::read('Storage.' . $storageType); \n\n$this-\u003eloadComponent('FileUpload.Upload', $config);\n$this-\u003eloadComponent('FileUpload.Download', $config);\n```\n\nUploading files\n\n```php\n$file = $this-\u003eUpload-\u003egetFile($this);\n// do something with file\n\n// store your file name in database\n$file-\u003egetFileName(); // sanitized file name - with removed restricted characters in the name\n```\n\n```php\n$file = $this-\u003eDownload-\u003egetFile($resource-\u003ename);\n// do something with file\n```\n\n:memo: Note that the function above will read content of file and you then need to use response to push it to the viewer. If you want to do it without using PHP you will need to get URL of file and if you using local storage manager your folder need to be in webrootfolder.\n\n```php\n$file-\u003eget('storagePath'); // local: /patht/to/sorage or bunny: https://cdn.your.tld/path/to/folder/\n// combine it with filename from your database go download it\n```\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaymeow%2Fcakephp-fileupload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaymeow%2Fcakephp-fileupload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaymeow%2Fcakephp-fileupload/lists"}