Open JoseNetoooo opened 8 years ago
I'm using this plugin and i find this proposition well ! I'm interested to be able to set a directory for every uploads at the same place !
any news ?
please. can any of you tell me how you did to upload an image??? because i don't know how to configure the uploadDir and uploadUrl in views, config and redactorModule (.php) files.
Hi!! I am using your plugin and that is my problem... In some projects I would like to set a different "directory" to save my images. In your extension you use the function $this->getOwnerPath() and the directory is always the user id or "guest". That is my proposal:
`class RedactorModule extends \yii\base\Module { // other variables public $directory = null;
// public function getDirectory() { return ($this->directory ? $this->directory : $this->getOwnerPath()); }
public function getSaveDir() { $path = Yii::getAlias($this->uploadDir) . DIRECTORY_SEPARATOR . $this->getDirectory(); if(!file_exists($path)){
if (!FileHelper::createDirectory($path, 0775,$recursive = true )) { throw new InvalidConfigException('$uploadDir does not exist and default path creation failed'); } } return $path; }
public function getUrl($fileName) { return Url::to($this->uploadUrl . '/' . $this->getDirectory() . '/' . $fileName); }
}`
Thanks so much for this plugin! It is very helpful for me!