src/AbstractUpload.php
protected function describeTargetFile($extension) {
		if ($this->targetDirectory === null) {
			throw new TargetDirectoryNotSpecifiedError();
		}

		$targetFilename = isset($this->targetFilename) ? $this->targetFilename : self::createRandomString();

		if (!File::mayNameBeValid($targetFilename)) {
			throw new InvalidFilenameException();
		}

		if (!$this->targetDirectory->exists() && !$this->targetDirectory->createRecursively(0755)) {
			throw new TargetFileWriteError();
		}

		return new File($this->targetDirectory, $targetFilename, $extension);
	}
protected function describeTargetFile($extension) {
		if ($this->targetDirectory === null) {
			throw new TargetDirectoryNotSpecifiedError();
		}

		$targetFilename = isset($this->targetFilename) ? $this->targetFilename : self::createRandomString();

		if (!File::mayNameBeValid($targetFilename)) {
			throw new InvalidFilenameException();
		}

		if (!$this->targetDirectory->exists() && !$this->targetDirectory->createRecursively(0755)) {
			throw new TargetFileWriteError();
		}

		return new File($this->targetDirectory, $targetFilename, $extension);
	}
protected function describeTargetFile ( $ extension ) { if ( $ this -> targetDirectory === null ) { throw new TargetDirectoryNotSpecifiedError ( ) ; } $ targetFilename = isset ( $ this -> targetFilename ) ? $ this -> targetFilename : self :: createRandomString ( ) ; if ( ! File :: mayNameBeValid ( $ targetFilename ) ) { throw new InvalidFilenameException ( ) ; } if ( ! $ this -> targetDirectory -> exists ( ) && ! $ this -> targetDirectory -> createRecursively ( 0755 ) ) { throw new TargetFileWriteError ( ) ; } return new File ( $ this -> targetDirectory , $ targetFilename , $ extension ) ; }
Returns a description of the target file

@param string $extension the filename extension to use
@return File the description of the targe file
@throws InvalidFilenameException if the supplied filename has been invalid
@throws Error (do *not* catch)
Returns a description of the target file