public function init()
    {
        parent::init(); // TODO: Change the autogenerated stub
        if (!$this->keepFileName) {
            $this->filename = $this->generateNewFilename();
        }
        if (empty($this->uploadDirectory)) {
            $this->uploadDirectory = Media::getCurrentDirectory();
        }
    }