当前位置: 首页>>代码示例>>PHP>>正文


PHP uploader::get_error方法代码示例

本文整理汇总了PHP中uploader::get_error方法的典型用法代码示例。如果您正苦于以下问题:PHP uploader::get_error方法的具体用法?PHP uploader::get_error怎么用?PHP uploader::get_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在uploader的用法示例。


在下文中一共展示了uploader::get_error方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uploader

     $inserterrors[] = 'No file specified.';
 }
 $my_uploader = new uploader();
 $my_uploader->max_filesize(ini_maxupload());
 $my_uploader->file_types($filetypes);
 $my_uploader->set_path($dir);
 if ($my_uploader->upload('upload')) {
     if ($my_uploader->save_file()) {
         $file = $dir . $my_uploader->fileinfo('filename');
         if (!file_exists($file)) {
             $inserterrors[] = 'File (' . $file . ') does not exist.';
         }
     }
 }
 if ($my_uploader->upload_failed()) {
     array_push($inserterrors, $my_uploader->get_error());
 }
 if (count($inserterrors) > 0) {
     error('admin.php?action=db&job=query', $inserterrors);
 } else {
     $ext = get_extension($file);
     if (($ext == 'zip' || $ext == 'sql') && file_exists($file)) {
         if ($ext == 'zip') {
             require_once 'classes/class.zip.php';
             $archive = new PclZip($file);
             if (($list = $archive->listContent()) == 0) {
                 error($archive->errorInfo(true));
             }
             $data = $archive->extractByIndex($list[0]['index'], PCLZIP_OPT_EXTRACT_AS_STRING);
             $lines = $data[0]['content'];
             unset($data);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:db.php

示例2: uploader

                if ($filesystem->mkdir($leadon . $ndir, 0777)) {
                    $path = $leadon . $ndir;
                }
            }
        }
        if ($error === null) {
            require "classes/class.upload.php";
            $my_uploader = new uploader();
            $my_uploader->max_filesize(ini_maxupload());
            $my_uploader->file_types($supportedextentions);
            $my_uploader->set_path($path);
            if ($my_uploader->upload('file')) {
                $my_uploader->save_file();
            }
            if ($my_uploader->upload_failed()) {
                $error = $my_uploader->get_error();
            }
            $image_file = $path . $my_uploader->fileinfo('filename');
            if (!file_exists($image_file)) {
                $error = $lang->phrase('admin_cms_file_does_not_exist');
            }
            $image_file = str_replace(realpath($config['fpath']) . DIRECTORY_SEPARATOR, '', $image_file);
            $image_file = str_replace(DIRECTORY_SEPARATOR, '/', $image_file);
        }
    }
    $filesize = formatFilesize(ini_maxupload());
    $htmlhead .= '<script type="text/javascript" src="templates/editor/wysiwyg-popup.js"></script>';
    echo head(' onLoad="loadImage();"');
    ?>
<form method="post" action="admin.php?action=cms&amp;job=doc_insert_image&amp;wysiwyg=<?php 
    echo $wysiwyg;
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:cms.php

示例3: elseif

 } elseif (isset($_FILES) && is_array($_FILES['upload']) && !empty($_FILES['upload']['name'])) {
     require "classes/class.upload.php";
     $my_uploader = new uploader();
     $my_uploader->max_filesize($config['avfilesize']);
     $my_uploader->max_image_size($config['avwidth'], $config['avheight']);
     $my_uploader->file_types(explode(',', $config['avfiletypes']));
     $my_uploader->set_path('uploads/pics/');
     $my_uploader->rename_file($my->id);
     if ($my_uploader->upload('upload')) {
         removeOldImages('uploads/pics/', $my->id);
         if ($my_uploader->save_file()) {
             $my->pic = 'uploads/pics/' . $my_uploader->fileinfo('filename');
         }
     }
     if ($my_uploader->upload_failed()) {
         error($my_uploader->get_error(), 'editprofile.php?action=pic');
     }
 } elseif (!empty($pic) && preg_match('/^(http:\\/\\/|www.)([\\wäöüÄÖÜ@\\-_\\.]+)\\:?([0-9]*)\\/(.*)$/', $pic)) {
     $my->pic = checkRemotePic($pic, $my->id);
     switch ($my->pic) {
         case REMOTE_INVALID_URL:
             $error[] = $lang->phrase('editprofile_pic_error1');
             $my->pic = '';
             break;
         case REMOTE_CLIENT_ERROR:
             $error[] = $lang->phrase('editprofile_pic_error2');
             $my->pic = '';
             break;
         case REMOTE_FILESIZE_ERROR:
         case REMOTE_IMAGE_HEIGHT_ERROR:
         case REMOTE_IMAGE_WIDTH_ERROR:
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:editprofile.php


注:本文中的uploader::get_error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。