Ejemplo n.º 1
0
    $template->display("error.tpl");
    die;
}
if ($action == "uploadAsync") {
    if (!$userpermissions["files"]["add"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "<h2>{$errtxt}</h2><br>{$noperm}");
        $template->display("error.tpl");
        die;
    }
    //if a folder for upload is set
    //otherwhise use the root folder
    if ($upfolder) {
        $thefolder = $myfile->getFolder($upfolder);
        $absfolder = $myfile->getAbsolutePathName($thefolder);
        if ($absfolder == "/") {
            $absfolder = "";
        }
        $thefolder = $thefolder["name"];
        $upath = "files/" . CL_CONFIG . "/{$id}" . $absfolder;
    } else {
        $upath = "files/" . CL_CONFIG . "/{$id}";
        $upfolder = 0;
    }
    //how many files to upload
    $num = count($_FILES);
    $chk = 0;
    //Loop through uploaded files
    foreach ($_FILES as $file) {
        //encrypt files in their tmp location