Exemplo n.º 1
0
         $tpl->assign('errorfile', ERROR_UPLOAD_ERR_NO_FILE);
         $bError = true;
     } else {
         if ($_FILES['file']['error'] == UPLOAD_ERR_FORM_SIZE || $_FILES['file']['error'] == UPLOAD_ERR_INI_SIZE) {
             $tpl->assign('errorfile', ERROR_UPLOAD_ERR_SIZE);
             $bError = true;
         } else {
             if ($_FILES['file']['error'] != UPLOAD_ERR_OK) {
                 $tpl->assign('errorfile', ERROR_UPLOAD_UNKNOWN);
                 $bError = true;
             } else {
                 if ($_FILES['file']['size'] > $opt['logic']['podcasts']['maxsize']) {
                     $tpl->assign('errorfile', ERROR_UPLOAD_ERR_SIZE);
                     $bError = true;
                 } else {
                     if ($podcast->allowedExtension($_FILES['file']['name']) == false) {
                         $tpl->assign('errorfile', ERROR_UPLOAD_ERR_TYPE);
                         $bError = true;
                     }
                 }
             }
         }
     }
 }
 if ($bError == false) {
     $podcast->setFilenames($_FILES['file']['name']);
     $podcast->setLocal(1);
     // try saving file and record
     if (!move_uploaded_file($_FILES['file']['tmp_name'], $podcast->getFilename())) {
         $tpl->assign('errorfile', ERROR_UPLOAD_UNKNOWN);
         $bError = true;