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


PHP uploader类代码示例

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


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

示例1: run

 public function run()
 {
     Yii::import('ext.editMe.vendors.kcfinder.core.*');
     Yii::import('ext.editMe.vendors.kcfinder.lib.*');
     $uploader = new uploader();
     $uploader->upload();
 }
开发者ID:syukrikhafidh,项目名称:appdefault,代码行数:7,代码来源:KCFinderUploaderAction.php

示例2: UploadFoto

function UploadFoto()
{
    require "modulos/fileupload/fileupload-class.php";
    $full = "productos_img/";
    //$mini = "productos_img/";
    $my_uploader = new uploader();
    $success = $my_uploader->upload("file", "", ".jpg");
    if ($success) {
        $modo = 2;
        $success = $my_uploader->save_file($full, $modo);
        if (!$success) {
            return false;
        }
        return $my_uploader->file['name'];
    }
    return false;
}
开发者ID:klich3,项目名称:gPOS,代码行数:17,代码来源:modproductos.php

示例3: uploadImg

 private function uploadImg()
 {
     if (isset($_POST['upfile']) || $_FILES['upfile']) {
         header("Content-Type:text/html;charset=utf-8");
         error_reporting(E_ERROR | E_WARNING);
         $config = array("savePath" => imgPath, "maxSize" => maxSize, "allowFiles" => array(".gif", ".png", ".jpg", ".jpeg", ".bmp"));
         $up = new uploader($_SESSION['weixinId'], $this->newsId, "upfile", $config);
         $type = $_REQUEST['type'];
         $callback = $_GET['callback'];
         $info = $up->getFileInfo();
         wxlog(json_encode($info));
         /**
          * 返回数据
          */
         if ($callback) {
             echo '<script>' . $callback . '(' . json_encode($info) . ')</script>';
         } else {
             echo json_encode($info);
         }
     }
 }
开发者ID:btbj,项目名称:wechat,代码行数:21,代码来源:newsEdit.php

示例4: numbers

    } else {
        $data = $my->about;
    }
    $chars = numbers($config['maxaboutlength']);
    $bbcode = initBBCodes();
    $inner['bbhtml'] = $bbcode->getbbhtml();
    $inner['smileys'] = $bbcode->getsmileyhtml($config['smileysperrow']);
    $mymodules->load('editprofile_about_top');
    echo $tpl->parse("editprofile/about");
} elseif ($_GET['action'] == "pic2") {
    $pic = $gpc->get('pic', none);
    if ($my->p['usepic'] == 0) {
        errorLogin($lang->phrase('not_allowed'), "editprofile.php");
    } 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']);
        if ($my_uploader->upload('upload', explode('|', $config['avfiletypes']))) {
            $my_uploader->save_file('uploads/pics/', '2');
        }
        if ($my_uploader->return_error()) {
            error($my_uploader->return_error(), 'editprofile.php?action=pic');
        } else {
            if (file_exists($my->pic)) {
                @unlink($my->pic);
            }
            $ext = $my_uploader->rename_file('uploads/pics/', $my_uploader->file['name'], $my->id);
        }
        $my->pic = 'uploads/pics/' . $my->id . $ext;
    } elseif (!empty($pic) && preg_match('/^(http:\\/\\/|www.)([\\wהצ�ִײ�@\\-_\\.]+)\\:?([0-9]*)\\/(.*)$/', $pic, $url_ary)) {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:editprofile.php

示例5: errorLogin

    if ($my->p['usepic'] == 0) {
        errorLogin($lang->phrase('not_allowed'), "editprofile.php");
    }
    removeOldImages('uploads/pics/', $my->id);
    $db->query("UPDATE {$db->pre}user SET pic = '' WHERE id = '{$my->id}' LIMIT 1");
    ($code = $plugins->load('editprofile_pic3_end')) ? eval($code) : null;
    ok($lang->phrase('editprofile_pic_success'), "editprofile.php?action=pic" . SID2URL_x);
} elseif ($_GET['action'] == "pic2") {
    $pic = $gpc->get('pic', none);
    if ($my->p['usepic'] == 0) {
        errorLogin($lang->phrase('not_allowed'), "editprofile.php");
    }
    $error = array();
    if (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();
        }
    } elseif (!empty($pic) && preg_match(URL_REGEXP, $pic)) {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:editprofile.php

示例6: explode

 $filesize *= 1024;
 $filetypes = explode('|', $filetypes);
 foreach ($filetypes as $key => $value) {
     if (empty($value)) {
         unset($filetypes[$key]);
     }
 }
 $insertuploads = array();
 $inserterrors = array();
 require "classes/class.upload.php";
 $success = 0;
 for ($i = 0; $i < $ups; $i++) {
     if (empty($_FILES['upload_' . $i]['name'])) {
         continue;
     }
     $my_uploader = new uploader();
     $my_uploader->max_filesize($filesize);
     $my_uploader->file_types($filetypes);
     $my_uploader->set_path($dir . DIRECTORY_SEPARATOR);
     if (isset($imgwidth) && isset($imgheight)) {
         $my_uploader->max_image_size($imgwidth, $imgheight);
     }
     if ($my_uploader->upload('upload_' . $i)) {
         $my_uploader->save_file();
     }
     if ($my_uploader->upload_failed()) {
         array_push($inserterrors, $my_uploader->get_error());
     }
     $file = $dir . DIRECTORY_SEPARATOR . $my_uploader->fileinfo('filename');
     if (!file_exists($file)) {
         $inserterrors[] = $lang->phrase('admin_explorer_file_does_not_exist');
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:explorer.php

示例7: foot

 </table>
</form>
	<?php 
    echo foot();
} elseif ($job == 'import2') {
    $overwrite = $gpc->get('overwrite', int);
    $server = $gpc->get('server', none);
    $del = $gpc->get('delete', int);
    $inserterrors = array();
    if (!empty($_FILES['upload']['name'])) {
        $filesize = 1024 * 1024;
        $filetypes = array('.zip');
        $dir = realpath('temp/');
        $insertuploads = array();
        require "classes/class.upload.php";
        $my_uploader = new uploader();
        $my_uploader->max_filesize($filesize);
        if ($my_uploader->upload('upload', $filetypes)) {
            $my_uploader->save_file($dir, 2);
            if ($my_uploader->return_error()) {
                array_push($inserterrors, $my_uploader->return_error());
            }
        } else {
            array_push($inserterrors, $my_uploader->return_error());
        }
        $file = $dir . '/' . $my_uploader->file['name'];
        if (!file_exists($file)) {
            $inserterrors[] = 'File (' . $file . ') does not exist.';
        }
    } elseif (file_exists($server)) {
        $ext = get_extension($server, true);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:language.php

示例8: incrementFileName

 /**
  * recursive file name incrementation untill no file with exsiting name
  * exists
  * @param string intial file name
  * @param string this recursions file name
  * @param int file version
  * @return string new file name
  */
 function incrementFileName($origFileName, $newFileName, $version)
 {
     if (JFile::exists($newFileName)) {
         $bits = explode('.', $newFileName);
         $ext = array_pop($bits);
         $f = implode('.', $bits);
         $f = rtrim($f, $version - 1);
         $newFileName = $f . $version . "." . $ext;
         $version++;
         $newFileName = uploader::incrementFileName($origFileName, $newFileName, $version);
     }
     return $newFileName;
 }
开发者ID:juliano-hallac,项目名称:fabrik,代码行数:21,代码来源:uploader.php

示例9: IN

             if (file_exists('uploads/topics/' . $row[0])) {
                 @unlink('uploads/topics/' . $row[0]);
             }
         }
         $db->query('DELETE FROM ' . $db->pre . 'uploads WHERE mid = "' . $upinfo['name'] . '" AND id IN (' . implode(',', $ids) . ')', __LINE__, __FILE__);
         viscacha_header('Location: attachments.php?type=' . $_GET['type'] . '&id=' . $_GET['id'] . SID2URL_JS_x);
     }
 } else {
     $insertuploads = array();
     $inserterrors = array();
     require "classes/class.upload.php";
     for ($i = 0; $i < $config['tpcmaxuploads']; $i++) {
         if (empty($_FILES['upload_' . $i]['name'])) {
             continue;
         }
         $my_uploader = new uploader();
         $my_uploader->max_filesize($config['tpcfilesize']);
         $my_uploader->max_image_size($config['tpcwidth'], $config['tpcheight']);
         if ($my_uploader->upload('upload_' . $i, explode('|', $config['tpcfiletypes']), 1)) {
             $my_uploader->save_file('uploads/topics/', '2');
         }
         if ($my_uploader->return_error()) {
             array_push($inserterrors, $my_uploader->return_error());
         }
         array_push($insertuploads, $my_uploader->file['name']);
     }
     if (count($inserterrors) > 0) {
         error($inserterrors, 'attachments.php?type=' . $_GET['type'] . '&amp;id=' . $_GET['id'] . SID2URL_x);
     }
     if ($_GET['type'] == 'edit' && ($my->mp[0] == 1 || $upinfo['name'] == $my->id)) {
         $upper = $upinfo['name'];
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:attachments.php

示例10: uploader

<?php

/** This file is part of KCFinder project
 *
 *      @desc Upload calling script
 *   @package KCFinder
 *   @version 2.51
 *    @author Pavel Tzonkov <pavelc@users.sourceforge.net>
 * @copyright 2010, 2011 KCFinder Project
 *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
 *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
 *      @link http://kcfinder.sunhater.com
 */
require "core/autoload.php";
$uploader = new uploader($modx);
$uploader->upload();
开发者ID:radist,项目名称:modx.evo.custom,代码行数:16,代码来源:upload.php

示例11: component

  <tr> 
   <td class="mbox" width="50%">Packed Component:<br><span class="stext">Compressed file containing the component (.zip). You should install only components from confidential sources!</td>
   <td class="mbox" width="50%"><input type="file" name="upload" size="60" /></td> 
  </tr>
  <tr> 
   <td class="ubox" width="100%" colspan="2" align="center"><input type="submit" name="Submit" value="Upload"></td> 
  </tr>
 </table>
</form> 
	<?php 
    echo foot();
} elseif ($job == 'com_add2') {
    echo head();
    if (isset($_FILES) && is_array($_FILES['upload']) && $_FILES['upload']['name']) {
        require "classes/class.upload.php";
        $my_uploader = new uploader();
        if ($my_uploader->upload('upload', array('.zip'))) {
            $my_uploader->save_file('temp/', '2');
        }
        if ($my_uploader->return_error()) {
            error('admin.php?action=cms&job=com_add', $my_uploader->return_error());
        } else {
            $tdir = "temp/" . time();
            $filesystem->mkdir($tdir);
            if (!is_dir($tdir)) {
                error('admin.php?action=cms&job=com_add', 'Directory could not be created for extraction.');
            }
            include 'classes/class.zip.php';
            $archive = new PclZip('temp/' . $my_uploader->file['name']);
            if ($archive->extract(PCLZIP_OPT_PATH, $tdir) == 0) {
                error('admin.php?action=cms&job=com_add', $archive->errorInfo(true));
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:cms.php

示例12: elseif

} elseif ($job == 'query') {
    echo head();
    exec_query_form();
    echo foot();
} elseif ($job == 'query2') {
    echo head();
    $type = $gpc->get('type', int);
    if ($type == 1) {
        $filetypes = array('zip', 'sql');
        $dir = 'temp/';
        $inserterrors = array();
        require "classes/class.upload.php";
        if (empty($_FILES['upload']['name'])) {
            $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) {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:db.php

示例13: menu

<!DOCTYPE HTML>
<html>
<head>
<title>Загрузка и обработка изображения</title>
<?php 
require_once "functions.php";
$menu = new menu();
if (!empty($_FILES)) {
    $uploader = new uploader();
    $uploader->checkAndMove();
}
if (!empty($_SESSION['filename'])) {
    $image = new image();
    $image->getDimensions();
    if (!empty($_POST['imageCrop'])) {
        $image->cropImage();
    }
}
?>
</head>
<body>
<center>
<h1>Загрузка и обработка изображения</h1>
<?php 
$menu->showUploadMenu();
if (!empty($_SESSION['filename'])) {
    $menu->showCropMenu();
    $image->checkCrop($menu);
    $menu->showSepia();
    if (!empty($_GET['sepia']) and $_GET['sepia'] == 'yes') {
        $image->applySepia();
开发者ID:dmitrii89,项目名称:PHP_image_processing,代码行数:31,代码来源:index.php

示例14: Object

<?php

include_once "act.portfolio.php";
// Файл для обработки логики
if ($user->login == $_SESSION['login']) {
    uploader::init(array(), $templates, 'portfolio');
}
?>
<script type="text/javascript">
    var categoryList = new Object();
    var currencyList = {0:"USD", 1:"Евро", 2:"Руб"}
    var timeTypeList = {0:"в часах", 1:"в днях", 2:"в месяцах", 3:"в минутах"}
</script>

<?php 
if ($_SESSION['login'] == $user->login) {
    ?>
    <?php 
    if ($user->is_pro != 't' && (int) $user->spec == 0) {
        ?>
        <div class="b-fon b-fon_pad_20">
            <div class="b-fon__body b-fon__body_pad_10 b-fon__body_padleft_30 b-fon__body_fontsize_13 b-fon__body_bg_ffeeeb">
                <span class="b-icon b-icon_sbr_rattent b-icon_margleft_-25"></span><a class="b-layout__link" href="/users/<?php 
        echo $user->login;
        ?>
/setup/specsetup/">Выберите специализацию</a>. Это небходимо, чтобы попасть в каталог фрилансеров, в котором вас найдут заказчики
            </div>
        </div>
    <?php 
    } elseif ($user->is_pro != 't' && (int) $user->spec != 0) {
        ?>
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:tpl.portfolio.pro.php

示例15: session_start

session_start();
// included files
include "../../../connection/phpmysqlconnect.php";
include "../../../library/CRUD_lib.php";
include "../../../library/miss_lib.php";
// post data
$user_id = $_POST['user_id'];
$month = $_POST['month'];
$year = $_POST['year'];
$modifier = $_SESSION["user"];
// File processing
$ext_array = array("xls", "csv", "xlsx");
$mime_array = array("application/vnd.ms-excel", "text/csv", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
$location = "../../media/performance-sheet/";
$file = new uploader();
if (is_uploaded_file($_FILES['file']['tmp_name'])) {
    if ($file->upload_validate($_FILES['file'], $ext_array, $mime_array) == true) {
        $file_name = $file->upload($_FILES['file'], $location);
        // insertion
        $column = array('performance_sheet', 'user_id', 'month', 'year', 'uploaded_by', 'modified_by');
        $value = array("{$file_name}", "{$user_id}", "{$month}", "{$year}", "{$modifier}", "{$modifier}");
        $insert = new crud($conn, 'employee_performance', $column, $value);
        $insert->insert();
        $move = new alert_redirect();
        $move->moveWithAlert('New Performance Sheet has been added', '../pages/addperformance.php');
    } else {
        $move = new alert_redirect();
        $move->moveWithAlert('File Extension not valid', '../pages/addperformance.php');
    }
    $move = new alert_redirect();
开发者ID:samtherock,项目名称:Optamac_final,代码行数:30,代码来源:add_performance.php


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