예제 #1
0
파일: upload.php 프로젝트: shifter/ospap2
             print "<span class='error'>File couldn't be written to the server. Drive may be full or read-only. Please contact the server administrator</span><br>";
             break;
         case UPLOAD_ERR_EXTENSION:
             print "<span class='error'>The file type you tried uploading is blocked.</span><br>";
             break;
         default:
             print "<span class='error'>" . htmlentities($name) . " failed to upload for an unknown reason. </span><br>";
     }
     continue;
 }
 if (!file_exists($tmp_name)) {
     print "<span class='error'>" . htmlentities($name) . " failed to upload for an unknown reason. </span><br>";
     continue;
 }
 if ($type == 'application/zip' || $type == 'application/octet-stream') {
     $arrPictures = clsPicture::createFromArchive($tmp_name, $objAlbum);
     if (is_string($arrPictures)) {
         print "<span class='error'>'" . htmlentities($name) . "' failed to upload: '<strong>" . $arrMessages[$arrPictures] . "</strong>'</span><br>";
     } else {
         foreach ($arrPictures as $objPicture) {
             if ($objPicture->exists('error')) {
                 print "<span class='error'>'" . $objPicture->get('name') . "' failed to upload: '<strong>" . $arrMessages[$objPicture->get('error')] . "</strong>'</span><br>";
             } else {
                 $objPicture->set('album_id', $objAlbum->get('id'));
                 if ($objUser) {
                     $objPicture->set('user_id', $objUser->get('id'));
                     $objPicture->set('username', $objUser->get('username'));
                 } else {
                     $objPicture->set('username', $_REQUEST['username']);
                 }
                 $objPicture->set('confirmed', 0);