Kecik/Request.php
public function move( $destination, $newName = '' ) {
		$source = $this->file['tmp_name'];

		if ( $destination != '' && substr( $destination, - 1 ) != '/' ) {
			$destination .= '/';
		}

		if ( ! empty( $newName ) ) {
			$target = $destination . $newName;
		} else {
			$target = $destination . $this->file['name'];
		}

		if ( ! @move_uploaded_file( $source, $target ) ) {
			$error = error_get_last();

			throw new FileException(
				sprintf(
					'Could not move the file "%s" to "%s" (%s)',
					$this->getPathname(),
					$target,
					strip_tags( $error['message'] )
				)
			);
		}

		@chmod( $target, 0666 & ~umask() );

		return $target;

	}
public function move( $destination, $newName = '' ) {
		$source = $this->file['tmp_name'];

		if ( $destination != '' && substr( $destination, - 1 ) != '/' ) {
			$destination .= '/';
		}

		if ( ! empty( $newName ) ) {
			$target = $destination . $newName;
		} else {
			$target = $destination . $this->file['name'];
		}

		if ( ! @move_uploaded_file( $source, $target ) ) {
			$error = error_get_last();

			throw new FileException(
				sprintf(
					'Could not move the file "%s" to "%s" (%s)',
					$this->getPathname(),
					$target,
					strip_tags( $error['message'] )
				)
			);
		}

		@chmod( $target, 0666 & ~umask() );

		return $target;

	}
public function move ( $ destination , $ newName = '' ) { $ source = $ this -> file [ 'tmp_name' ] ; if ( $ destination != '' && substr ( $ destination , - 1 ) != '/' ) { $ destination .= '/' ; } if ( ! empty ( $ newName ) ) { $ target = $ destination . $ newName ; } else { $ target = $ destination . $ this -> file [ 'name' ] ; } if ( ! @ move_uploaded_file ( $ source , $ target ) ) { $ error = error_get_last ( ) ; throw new FileException ( sprintf ( 'Could not move the file "%s" to "%s" (%s)' , $ this -> getPathname ( ) , $ target , strip_tags ( $ error [ 'message' ] ) ) ) ; } @ chmod ( $ target , 0666 & ~ umask ( ) ) ; return $ target ; }
Move file from temporary to actual location

@param        $destination
@param string $newName

@return string
@throws FileException
Move file from temporary to actual location