$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)) { $loai = $row[0]; } $a->setMA_FILE($num); $a->setKICH_THUOC_FILE($fileSize); $a->setMA_HOA_FILE($mahoafile); $a->setMA_LOAI_CHIA_SE("ml02"); $a->setMA_LOAI_FILE($loai); $a->setMA_THU_MUC($matm); $a->setMAT_KHAU_CS_FILE(""); $a->setSO_LUOT_DOWN("0");