codem / silverstripe-damn-fine-uploader
An HTML5 upload field for Silverstripe 4, including editable form fields for silverstripe/userforms
Installs: 4 704
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 3
Open Issues: 5
Type:silverstripe-vendormodule
Requires
- php: ^7.4 || ^8.0
- silverstripe/mimevalidator: ^2.3.0
- silverstripe/userforms: ^5.11.0
- symbiote/silverstripe-multivaluefield: ^5.3.0
Requires (Dev)
- codeception/codeception: ^4.2
- friendsofphp/php-cs-fixer: ^3
- phpunit/phpunit: ^9.5
- vlucas/phpdotenv: ^5
Suggests
- dnadesign/silverstripe-elemental-userforms: Provides form content blocks as part of elemental
This package is auto-updated.
Last update: 2024-10-30 04:31:43 UTC
README
An upload field that can be used to upload files to a Silverstripe website.
The frontend uses Uppy to handle & submit client uploads.
Features
- a page model + controller allowing upload of one or more files to a chosen folder
- support for userforms via an editable upload field
- mime type validation via silverstripe/mimevalidator
- sub resource integrity (SRI) support for generated requirements
- thumbnail generation of uploaded images for the silverstripe/asset-admin
- min/max image dimension verification (via Uppy)
- configurable file size restrictions
- restrict uploads by one or more file types
- restrict uploads by file size
This module is not intended for use in the Silverstripe administration area, use the standard UploadField for that.
Installing
composer require codem/silverstripe-damn-fine-uploader
Upload security
In the module and administration area
- Set asset folders chosen as upload targets to be restricted (i.e no public access)
- Verify the above by attempting to access file URLs anonymously
Generally
- Use the
public
directory setup process available in more recent versions of Silverstripe - Ensure your web server is configured to not serve files that can be considered dangerous if they are served from an upload directory
- Review upload fields periodically to ensure they are configured correctly
Configuration
Have a look in _config/config.yml
for various configuration options and see also Default Configuration
Modify the signing_key
value in your project configuration, along with anything else you like (e.g upload size limits)
The implementation
entry can be used to add any configuration value supported by the field.
Fields
See fields documentation for examples.
Browser support
All the good ones. The Uppy website provides a list of supported browsers
Even though Uppy purports to support Internet Explorer, any bugs raised related to Internet Explorer will be closed.
Issues
Please add feature requests and bug reports to the Github issue tracker
Security
If you have found a security issue in this module, please email git {at} codem dot com dot au in the first instance.
License
BSD-3-Clause
Roadmap
- File removal support in Uppy
- Grouped uploads
- Possible usage of the
filepond
library as an alternative frontend implementation
Thanks
Thanks for reading, here's a silly meme: