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


PHP upload::upload_config方法代码示例

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


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

示例1: insert

 public function insert()
 {
     $msg = array();
     $path = isset($_POST['path']) ? _encrypt($_POST['path'], 'DECODE') : '';
     $size = isset($_POST['size']) ? _encrypt($_POST['size'], 'DECODE') : 0;
     $type = isset($_POST['type']) ? _encrypt($_POST['type'], 'DECODE') : 'image';
     $type = explode(',', $this->getUPtype($type, true));
     $watermark = $_POST['iswatermark'] == "true" ? "yes" : "no";
     if (!is_dir(G_UPLOAD . $path)) {
         $msg['ok'] = 'no';
         $msg['text'] = $path . "文件夹不存在";
         echo json_encode($msg);
         exit;
     }
     System::load_app_class("admin", G_ADMIN_DIR, "no");
     $admincheck = admin::StaticCheckAdminInfo() ? 1 : 0;
     if (is_array($_FILES['Filedata'])) {
         System::load_sys_class('upload', 'sys', 'no');
         upload::upload_config($type, $size, $path);
         upload::go_upload($_FILES['Filedata'], $watermark);
         if (!upload::$ok) {
             $msg['ok'] = 'no';
             $msg['text'] = upload::$error;
         } else {
             $msg['ok'] = 'yes';
             $msg['text'] = $path . '/' . upload::$filedir . "/" . upload::$filename;
         }
         echo json_encode($msg);
     }
 }
开发者ID:think-css,项目名称:yungou,代码行数:30,代码来源:uploadify.action.php

示例2: upimage

 public function upimage()
 {
     //System::load_app_class('Uploader','','no');
     //上传图片框中的描述表单名称,
     //$title = htmlspecialchars($_POST['pictitle'], ENT_QUOTES);
     //$path = htmlspecialchars($_POST['dir'], ENT_QUOTES);
     if (!isset($_POST['pictitle']) && !isset($_FILES['upfile'])) {
         exit;
     }
     $title = $_POST['pictitle'];
     $path = G_UPLOAD . 'shopimg/';
     System::load_sys_class('upload', 'sys', 'no');
     upload::upload_config(array('png', 'jpg', 'jpeg', 'gif'), 500000, 'shopimg');
     upload::go_upload($_FILES['upfile']);
     if (!upload::$ok) {
         $url = '';
         $title = $title;
         $originalName = '';
         $state = upload::$error;
     } else {
         $url = G_UPLOAD_PATH . '/shopimg/' . upload::$filedir . "/" . upload::$filename;
         $title = $title;
         $originalName = '';
         $state = 'SUCCESS';
     }
     echo "{'url':'" . $url . "','title':'" . $title . "','original':'" . $originalName . "','state':'" . $state . "'}";
     //{'url':'upload/20130728/13749880933714.jpg','title':'梨花.jpg','original':'梨花.jpg','state':'SUCCESS'}
 }
开发者ID:ping199143,项目名称:1ydb,代码行数:28,代码来源:ueditor.action.php

示例3: insert

 public function insert()
 {
     $msg = array();
     $path = isset($_POST['path']) ? _encrypt($_POST['path'], 'DECODE') : '';
     $size = isset($_POST['size']) ? _encrypt($_POST['size'], 'DECODE') : 0;
     $type = isset($_POST['type']) ? _encrypt($_POST['type'], 'DECODE') : 'image';
     $type = explode(',', $this->getUPtype($type, true));
     if (!is_dir(G_UPLOAD . $path)) {
         $msg['ok'] = 'no';
         $msg['text'] = $path . "文件夹不存在";
         echo json_encode($msg);
         exit;
     }
     if (is_array($_FILES['Filedata'])) {
         System::load_sys_class('upload', 'sys', 'no');
         upload::upload_config($type, $size, $path);
         upload::go_upload($_FILES['Filedata']);
         if (!upload::$ok) {
             $msg['ok'] = 'no';
             $msg['text'] = upload::$error;
         } else {
             $msg['ok'] = 'yes';
             $msg['text'] = $path . '/' . upload::$filedir . "/" . upload::$filename;
         }
         echo json_encode($msg);
     }
 }
开发者ID:king3388,项目名称:king,代码行数:27,代码来源:uploadify.action.php

示例4: quanzi_update

 public function quanzi_update()
 {
     $id = intval($this->segment(4));
     $quanzi = $this->db->GetOne("select * from `@#_quanzi` where `id`='{$id}'");
     if (!$quanzi) {
         _message("参数错误");
     }
     if (isset($_POST["submit"])) {
         if ($_POST['title'] == null) {
             _message("圈子名不能为空");
         }
         $title = htmlspecialchars($_POST['title']);
         $guanli = intval($_POST['guanli']);
         $jiaru = $_POST['jiaru'];
         $jianjie = htmlspecialchars($_POST['jianjie']);
         $gongao = htmlspecialchars($_POST['gongao']);
         $time = time();
         if (isset($_FILES['img'])) {
             System::load_sys_class('upload', 'sys', 'no');
             upload::upload_config(array('png', 'jpg', 'jpeg', 'gif'), 500000, 'quanzi');
             upload::go_upload($_FILES['img']);
             if (!upload::$ok) {
                 _message(upload::$error, null, 3);
             } else {
                 $img = upload::$filedir . "/" . upload::$filename;
                 $size = getimagesize(G_UPLOAD_PATH . "/quanzi/" . $img);
                 $max = 120;
                 $w = $size[0];
                 $h = $size[1];
                 if ($w > 120 or $h > 120) {
                     if ($w > $h) {
                         $w2 = $max;
                         $h2 = $h * ($max / $w);
                         upload::thumbs($w2, $h2, 1);
                     } else {
                         $h2 = $max;
                         $w2 = $w * ($max / $h);
                         upload::thumbs($w2, $h2, 1);
                     }
                 }
             }
         } else {
             $img = $_POST['imgold'];
         }
         $this->db->Query("UPDATE `@#_quanzi` SET title='{$title}',img='{$img}',guanli='{$guanli}',jianjie='{$jianjie}',gongao='{$gongao}',jiaru='{$jiaru}',time='{$time}' where`id`='{$id}'");
         _message("修改成功", WEB_PATH . "/admin/quanzi");
     }
     include $this->tpl(ROUTE_M, 'quanzi.update');
 }
开发者ID:haidao17,项目名称:backend,代码行数:49,代码来源:quanzi.action.php

示例5: shop_img_insert

 public function shop_img_insert()
 {
     if (is_array($_FILES['Filedata'])) {
         System::load_sys_class('upload', 'sys', 'no');
         upload::upload_config(array('png', 'jpg', 'jpeg', 'gif'), 500000, 'shopimg');
         upload::go_upload($_FILES['Filedata']);
         $msg = array();
         if (!upload::$ok) {
             $msg['ok'] = 'no';
             $msg['text'] = upload::$error;
         } else {
             $msg['ok'] = 'yes';
             $msg['text'] = upload::$filedir . "/" . upload::$filename;
         }
         echo json_encode($msg);
     }
 }
开发者ID:haidao17,项目名称:backend,代码行数:17,代码来源:shop.action.php

示例6: modifiylink

 public function modifiylink()
 {
     $linkid = intval($this->segment(4));
     $linkinfo = $this->db->GetOne("SELECT * FROM `@#_link` where `id`='{$linkid}'");
     if (!$linkinfo) {
         _message("参数不正确");
     }
     if (isset($_POST['submit'])) {
         $name = htmlspecialchars($_POST['name']);
         $url = htmlspecialchars($_POST['url']);
         if ($linkinfo['type'] == 1) {
             $this->db->Query("UPDATE `@#_link` SET `name`='{$name}',`url`='{$url}' WHERE `id`={$linkid}");
             if ($this->db->affected_rows()) {
                 _message("修改成功", WEB_PATH . '/' . ROUTE_M . '/' . ROUTE_C . "/lists");
             } else {
                 _message("修改失败");
             }
         }
         if ($linkinfo['type'] == 2) {
             $logo = $linkinfo['logo'];
             if (isset($_FILES['image'])) {
                 System::load_sys_class('upload', 'sys', 'no');
                 upload::upload_config(array('png', 'jpg', 'jpeg', 'gif'), 500000, 'linkimg');
                 upload::go_upload($_FILES['image']);
                 if (!upload::$ok) {
                     _message(upload::$error, WEB_PATH . '/' . ROUTE_M . '/' . ROUTE_C . "/lists");
                 }
                 $logo = upload::$filedir . "/" . upload::$filename;
             }
             $this->db->Query("UPDATE `@#_link` SET `name`='{$name}',`url`='{$url}',`logo`='{$logo}' WHERE `id`='{$linkid}'");
             if ($this->db->affected_rows()) {
                 _message("修改成功", WEB_PATH . '/' . ROUTE_M . '/' . ROUTE_C . "/lists");
             } else {
                 _message("修改失败");
             }
         }
     }
     include $this->tpl(ROUTE_M, 'link.editlink');
 }
开发者ID:ping199143,项目名称:1ydb,代码行数:39,代码来源:link.action.php

示例7: singphotoup

 public function singphotoup()
 {
     if (!empty($_FILES)) {
         /*
         	更新时间:2014-04-28
         	xu
         */
         /*
         			$uid=isset($_POST['uid']) ? $_POST['uid'] : NULL;		
         			$ushell=isset($_POST['ushell']) ? $_POST['ushell'] : NULL;
         			$login=$this->checkuser($uid,$ushell);
         			if(!$login){echo "上传失败";exit;}
         */
         System::load_sys_class('upload', 'sys', 'no');
         upload::upload_config(array('png', 'jpg', 'jpeg', 'gif'), 1000000, 'shaidan');
         upload::go_upload($_FILES['Filedata']);
         if (!upload::$ok) {
             echo _message(upload::$error, null, 3);
         } else {
             $img = upload::$filedir . "/" . upload::$filename;
             $size = getimagesize(G_UPLOAD_PATH . "/shaidan/" . $img);
             $max = 700;
             $w = $size[0];
             $h = $size[1];
             if ($w > 700) {
                 $w2 = $max;
                 $h2 = $h * ($max / $w);
                 upload::thumbs($w2, $h2, 1);
             }
             echo trim("shaidan/" . $img);
         }
     }
 }
开发者ID:ping199143,项目名称:1ydb,代码行数:33,代码来源:home.action.php


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