$n = count($exts) - 1;
    $exts = $exts[$n];
    return $exts;
}
$fileName = $_FILES["file1"]["name"];
// The file name
$fileTmpLoc = $_FILES["file1"]["tmp_name"];
// File in the PHP tmp folder
$fileType = $_FILES["file1"]["type"];
// The type of file it is
$fileSize = $_FILES["file1"]["size"];
// File size in bytes
$fileErrorMsg = $_FILES["file1"]["error"];
$matm = $_POST["mathumuc"];
$a = new File();
$res = $a->maxfile();
$num = 0;
$mahoa = "sharefile";
while ($row = mysql_fetch_array($res)) {
    $num = $row[0] + 1;
}
$mahoa = "sharefile" . $num;
$mahoafile = md5($mahoa);
$resu = $a->CURDATE();
while ($roww = mysql_fetch_array($resu)) {
    $a->setNGAY_TAO($roww[0]);
}
$b = new loai_file();
$ress = $b->tiemkiemduoi(findexts($fileName));
$loai = "1";
while ($row = mysql_fetch_array($ress)) {