diff --git a/src/Element/Upload.php b/src/Element/Upload.php index f248caf..2cb851e 100644 --- a/src/Element/Upload.php +++ b/src/Element/Upload.php @@ -20,7 +20,7 @@ class Upload extends FileElement { public function getInfo() { $info = parent::getInfo(); $info['#required'] = FALSE; - $info['#upload_location'] = 'public://'; + $info['#upload_location'] = 'public://'.date('Y').'-'.date('m').'/'; $info['#upload_validators'] = []; $info['#element_validate'] = [ [static::class, 'validate'], diff --git a/src/Plugin/EntityBrowser/Widget/FileUpload.php b/src/Plugin/EntityBrowser/Widget/FileUpload.php index 877de72..fba13a2 100644 --- a/src/Plugin/EntityBrowser/Widget/FileUpload.php +++ b/src/Plugin/EntityBrowser/Widget/FileUpload.php @@ -60,6 +60,7 @@ class FileUpload extends EntityFormProxy { '#process' => [ [$this, 'processUploadElement'], ], + '#upload_location' => 'public://'.date('Y').'-'.date('m').'/', '#upload_validators' => $this->getUploadValidators(), '#weight' => 70, ];