fuel/fuel/core/classes/upload.php
public static function get_errors($index = null)
	{
		// convert element name formats
		is_string($index) and $index = str_replace(':', '.', $index);

		$files = static::$upload->getInvalidFiles($index);

		// convert the file object to 1.x compatible data
		$result = array();

		foreach ($files as $file)
		{
			$data = array();
			foreach ($file as $item => $value)
			{
				// swap item names for BC
				$item == 'element' and $item = 'field';
				$item == 'tmp_name' and $item = 'file';
				$item == 'filename' and $item = 'saved_as';
				$item == 'path' and $item = 'saved_to';
				$data[$item] = $value;
			}
			$data['field'] = str_replace('.', ':', $data['field']);
			$data['error'] = ! $file->isValid();
			$data['errors'] = array();
			foreach ($file->getErrors() as $error)
			{
				$data['errors'][] = array('error' => $error->getError(), 'message' => $error->getMessage());
			}
			$result[] = $data;
		}

		// compatibility with < 1.5, return the single entry if only one was found
		if (func_num_args() and count($result) == 1)
		{
			return reset($result);
		}
		else
		{
			return $result;
		}
	}
public static function get_errors($index = null)
	{
		// convert element name formats
		is_string($index) and $index = str_replace(':', '.', $index);

		$files = static::$upload->getInvalidFiles($index);

		// convert the file object to 1.x compatible data
		$result = array();

		foreach ($files as $file)
		{
			$data = array();
			foreach ($file as $item => $value)
			{
				// swap item names for BC
				$item == 'element' and $item = 'field';
				$item == 'tmp_name' and $item = 'file';
				$item == 'filename' and $item = 'saved_as';
				$item == 'path' and $item = 'saved_to';
				$data[$item] = $value;
			}
			$data['field'] = str_replace('.', ':', $data['field']);
			$data['error'] = ! $file->isValid();
			$data['errors'] = array();
			foreach ($file->getErrors() as $error)
			{
				$data['errors'][] = array('error' => $error->getError(), 'message' => $error->getMessage());
			}
			$result[] = $data;
		}

		// compatibility with < 1.5, return the single entry if only one was found
		if (func_num_args() and count($result) == 1)
		{
			return reset($result);
		}
		else
		{
			return $result;
		}
	}
public static function get_errors ( $ index = null ) { // convert element name formats is_string ( $ index ) and $ index = str_replace ( ':' , '.' , $ index ) ; $ files = static :: $ upload -> getInvalidFiles ( $ index ) ; // convert the file object to 1.x compatible data $ result = array ( ) ; foreach ( $ files as $ file ) { $ data = array ( ) ; foreach ( $ file as $ item => $ value ) { // swap item names for BC $ item == 'element' and $ item = 'field' ; $ item == 'tmp_name' and $ item = 'file' ; $ item == 'filename' and $ item = 'saved_as' ; $ item == 'path' and $ item = 'saved_to' ; $ data [ $ item ] = $ value ; } $ data [ 'field' ] = str_replace ( '.' , ':' , $ data [ 'field' ] ) ; $ data [ 'error' ] = ! $ file -> isValid ( ) ; $ data [ 'errors' ] = array ( ) ; foreach ( $ file -> getErrors ( ) as $ error ) { $ data [ 'errors' ] [ ] = array ( 'error' => $ error -> getError ( ) , 'message' => $ error -> getMessage ( ) ) ; } $ result [ ] = $ data ; } // compatibility with < 1.5, return the single entry if only one was found if ( func_num_args ( ) and count ( $ result ) == 1 ) { return reset ( $ result ) ; } else { return $ result ; } }
Get the list of non-validated files

@return	array	list of uploaded files that failed to validate
Get the list of non - validated files