FileSystemResourceManager.php
public function save($file, $name, $options = [])
	{
		$name = ltrim($name, DIRECTORY_SEPARATOR);
		
		if ($folder = trim(ArrayHelper::getValue($options, 'folder'), DIRECTORY_SEPARATOR)) {
			$name = $folder . DIRECTORY_SEPARATOR . $name;
		}
		
		if (!ArrayHelper::getValue($options, 'override', true) && $this->fileExists($name)) {
			return false;
		}
		
		$path = $this->getBasePath() . DIRECTORY_SEPARATOR . $name;
		@mkdir(dirname($path), 0777, true);

		return $file->saveAs($path);
	}
public function save($file, $name, $options = [])
	{
		$name = ltrim($name, DIRECTORY_SEPARATOR);
		
		if ($folder = trim(ArrayHelper::getValue($options, 'folder'), DIRECTORY_SEPARATOR)) {
			$name = $folder . DIRECTORY_SEPARATOR . $name;
		}
		
		if (!ArrayHelper::getValue($options, 'override', true) && $this->fileExists($name)) {
			return false;
		}
		
		$path = $this->getBasePath() . DIRECTORY_SEPARATOR . $name;
		@mkdir(dirname($path), 0777, true);

		return $file->saveAs($path);
	}
Saves a file
@param \yii\web\UploadedFile $file the file uploaded
@param string $name the name of the file. If empty, it will be set to the name of the uploaded file
@param array $options to save the file. The options can be any of the following:
- `folder` : whether we should create a subfolder where to save the file
- `override` : whether we allow rewriting a existing file
@return boolean