Section
#1
.
, .
bytes.
<?php
//SECTION #2
if
($temp_file_name) {
$size = filesize($temp_file_name);
if ($size < $kb)
{
$file_size = "$size Bytes";
}
elseif ($size < $mb) {
$final =
round($size/$kb,2);
$file_size = "$final KB";
}
elseif ($size < $gb)
{
$final = round($size/$mb,2);
$file_size = "$final
MB";
}
elseif($size < $tb) {
$final =
round($size/$gb,2);
$file_size = "$final GB";
} else {
$final =
round($size/$tb,2);
$file_size = "$final TB";
}
} else {
$file_size
= "ERROR: NO FILE PASSED TO get_file_size()";
}
return
$file_size;
}
?>
Section #2
.
$temp_file_name , .
$temp_file_name, bytes PHP
filesize(). log file.
Function #5 ( Max File
Size)
<?php
function get_max_size() {
$max_file_size =
trim($this->max_file_size);
$kb = 1024;
$mb = 1024 * $kb;
$gb = 1024
* $mb;
$tb = 1024 * $gb;
if ($max_file_size) {
if ($max_file_size
< $kb) {
$max_file_size = "max_file_size Bytes";
}
elseif
($max_file_size < $mb) {
$final =
round($max_file_size/$kb,2);
$max_file_size = "$final KB";
}
elseif
($max_file_size < $gb) {
$final =
round($max_file_size/$mb,2);
$max_file_size = "$final
MB";
}
elseif($max_file_size < $tb) {
$final =
round($max_file_size/$gb,2);
$max_file_size = "$final GB";
} else
{
$final = round($max_file_size/$tb,2);
$max_file_size = "$final
TB";
}
} else {
$max_file_size = "ERROR: NO SIZE PARAMETER PASSED TO
get_max_size()";
}
return $max_file_size;
}
?>
, .
, .
, upload- file,
.
.
----------------------------
Function #6 (Validation of The
User)
<?php
function validate_user() {
//SECTION
#1
$banned_array = $this->banned_array;
$ip =
trim($_SERVER['REMOTE_ADDR']);
$cpu = gethostbyaddr($ip);
$count =
count($banned_array);
//SECTION #2
if ($count < 1) {
return
true;
} else {
foreach($banned_array as $key => $value) {
if ($value
== $ip ."-". $cpu) {
return false;
} else {
return
true;
}}}}
?>
,
upload-. class ,
. IP. ,
upload- , ,
, , .
, upload- , , ,
upload- IP .
, ,
upload .
<?php
function validate_user() {
//SECTION
#1
$banned_array = $this->banned_array;
$ip =
trim($_SERVER['REMOTE_ADDR']);
$cpu = gethostbyaddr($ip);
$count =
count($banned_array);
?>