Level51\S3\S3UploadField
Upload field for S3Files using dropzone.js
Synopsis
class S3UploadField
extends FormField
{
- // members
- protected $region;
- protected $bucket;
- protected string|null $folderName;
- protected $maxFileSize;
- protected $timeout;
- protected $acceptedFiles;
- protected array $customPayload = ;
- // methods
- public void Field()
- public string getPayload()
- public string getBucketUrl()
- public string getRegion()
- public string getBucket()
- public bool|string getFolderName()
- public int getMaxFileSize()
- public null|string getAcceptedFiles()
- public mixed getTimeout()
- public DataObject|S3File getFile()
- public array getCustomPayload()
- public $this setRegion()
- public $this setBucket()
- public $this setFolderName()
- public $this addAcceptedFile()
- public $this setAcceptedFiles()
- public S3UploadField setAllowedExtensions()
- public $this setMaxFileSize()
- public $this setTimeout()
- public $this setCustomPayload()
- public $this addCustomPayload()
- public $this setRecordCreateCallback()
- public $this setRecordDeleteCallback()
Hierarchy
Extends
- SilverStripe\Forms\FormField
Members
protected
- $acceptedFiles
—
array
List of accepted file types. - $bucket — string
- $customPayload
—
array
Custom payload passed to the handleFileUpload method of the upload controller. - $folderName — Level51\S3\string|null
- $maxFileSize — int
- $region — string
- $timeout — int
Methods
public
- Field()
- addAcceptedFile() — Add an acceptedFiles entry.
- addCustomPayload() — Add something to the custom payload array.
- getAcceptedFiles() — Get accepted files config.
- getBucket() — Get the bucket name, either custom for this field or from the config.
- getBucketUrl() — Get the URL of our bucket based off the bucket name and its region.
- getCustomPayload() — Get any kind of custom payload.
- getFile() — Get the file record according to the value if set.
- getFolderName() — Get the folder name if set, false otherwise.
- getMaxFileSize() — The max allowed file size.
- getPayload() — Get frontend payload.
- getRegion() — Get the region name, either custom for this field or from the config.
- getTimeout() — Get the timeout for the dropzone component.
- setAcceptedFiles() — Set the accepted file types / extensions.
- setAllowedExtensions()
- setBucket()
- setCustomPayload() — Set some custom payload.
- setFolderName()
- setMaxFileSize() — Override the allowed max file size.
- setRecordCreateCallback() — Set a callback triggered on the given record after successful S3File creation.
- setRecordDeleteCallback() — Set a callback griggered on the given record during S3File deletion.
- setRegion()
- setTimeout() — Override the config timeout value for this field.