includes/php/upload.php
//Check if file size is allowed
Check if file size is allowed
Check if file size is allowed
private function checkSize()
	{
		$max_file_size = $this->max_file_size;
		$size = $this->file_size;
		$rang 		= substr($max_file_size,-1);
		$max_size 	= !is_numeric($rang) && !is_numeric($max_file_size)? str_replace($rang, '', $max_file_size): $max_file_size;
		if($rang && $max_size)
		{
			switch (strtoupper($rang))
			{
				case 'Y': $max_size = $max_size*1024;				case 'Z': $max_size = $max_size*1024;
				case 'E': $max_size = $max_size*1024;
				case 'P': $max_size = $max_size*1024;
				case 'T': $max_size = $max_size*1024;
				case 'G': $max_size = $max_size*1024;
				case 'M': $max_size = $max_size*1024;
				case 'K': $max_size = $max_size*1024;
			}
		}
		if(!empty($max_file_size) && $size>$max_size)
		{
			return false;
		}
		return true;
	}
private function checkSize ( ) { $ max_file_size = $ this -> max_file_size ; $ size = $ this -> file_size ; $ rang = substr ( $ max_file_size , - 1 ) ; $ max_size = ! is_numeric ( $ rang ) && ! is_numeric ( $ max_file_size ) ? str_replace ( $ rang , '' , $ max_file_size ) : $ max_file_size ; if ( $ rang && $ max_size ) { switch ( strtoupper ( $ rang ) ) { case 'Y' : $ max_size = $ max_size * 1024 ; case 'Z' : $ max_size = $ max_size * 1024 ; case 'E' : $ max_size = $ max_size * 1024 ; case 'P' : $ max_size = $ max_size * 1024 ; case 'T' : $ max_size = $ max_size * 1024 ; case 'G' : $ max_size = $ max_size * 1024 ; case 'M' : $ max_size = $ max_size * 1024 ; case 'K' : $ max_size = $ max_size * 1024 ; } } if ( ! empty ( $ max_file_size ) && $ size > $ max_size ) { return false ; } return true ; }
Check if file size is allowed
Check if file size is allowed
//------------------max file size check from js //1024 or 1000?? //Yotta byte, will arrive such day???
 //-----------------End max file size check