$path, 'name' => $file['name'], 'type' => $file['type'], ]); $this->tmpFile = $file['tmp_name']; } /** * Uploads the file, only if doesn't exist yet. * * @return bool */ public function upload() { if ($this->exists()) { // the file already exists, we don't need to upload it return true; } // attempt file upload return JFile::upload($this->tmpFile, $this->getPath(), $useStreams = false, $allowUnsafe = true); } }