protected function get_unique_filename($file_path, $name, $size, $type, $error, $index, $content_range) { if ($this->fm->config['upload']['overwrite']) { return $name; } return parent::get_unique_filename($file_path, $name, $size, $type, $error, $index, $content_range); }
public function delete($print_response = true) { $result = parent::delete($print_response); if ($result['success'] === true) { $this->folder->deletePicturesByName($this->Files); } return $result; }
/** * These methods are handled by the BaseUploadHandler * * public function Start(); * public function get_response(); * public function get_headers(); * public function set_option(string $key, string $value); */ function __construct($options, $arguments = null) { $folder = $arguments; if (!$folder instanceof \Album and (!is_numeric($arguments) or !($folder = \Album::find($arguments)))) { throw new \Exception("DatabaseUploadHandler needs the Album id or the Album model to start!"); } $this->folder = $folder; $options['upload_dir'] = $folder->upload_dir; $options['upload_url'] = $folder->upload_url; parent::__construct($options); }
/** * These methods are handled by the BaseUploadHandler * * public function Start(); * public function get_response(); * public function get_headers(); * public function set_option(string $key, string $value); * * Actually the BaseUploadHandler itself already * handles the files so really nothing to do here. * */ function __construct($options, $arguments = null) { parent::__construct($options); }