Exemplo n.º 1
0
                 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;
     } else {
         if ($podcast->save()) {
             if ($redirect == '') {
                 $redirect = 'viewcache.php?cacheid=' . urlencode($podcast->getCacheId());
             }
             $tpl->redirect($redirect);
         } else {
             $tpl->assign('errorfile', ERROR_UPLOAD_UNKNOWN);
             $bError = true;
         }
     }