codecamp

index.php

<?php
/*
* @copyright   Leyun internet Technology(Shanghai)Co.,Ltd
* @license     http://www.dzzoffice.com/licenses/license.txt
* @package     DzzOffice
* @version     DzzOffice 1.1 2014.07.05
* @link        http://www.dzzoffice.com
* @author      zyx(zyx@dzz.cc)
*/
if(!defined('IN_DZZ')) {
        exit('Access Denied');
}
$do=empty($_GET['do'])?'':trim($_GET['do']);
if($do=='save'){ //图片保存接口
        $path=rawurldecode($_GET['path']); //文件保存位置
        $tpath=empty($_GET['tpath'])?'':rawurldecode($_GET['tpath']); //覆盖原有文件
        $name=rawurldecode($_GET['name']); //文件名
        $post_input = 'php://input';
        
        if($tpath){ //覆盖原有文件
                //获取文件内容
                $fileContent='';
                $handle=fopen('php://input', 'r');
                while (!feof($handle)) {
                  $fileContent .= fread($handle, 8192);
                }
                 $icoarr=IO::setFileContent($tpath,$fileContent);
        }else{ //新建文件
                $re=IO::uploadStream($post_input,$name,$path); //上传文件到服务器
                if(empty($re['error'])){
                        $icoarr=$re['icoarr'][0];
                }else{
                        $icoarr=$re;
                }
        }
        echo json_encode($icoarr); //返回
        exit();
}else{
        $path=rawurldecode($_GET['path']); //根据文件路径打开文件
        if($path) $stream=$_G['siteurl'].DZZSCRIPT.'?mod=io&op=thumbnail&width=1440&height=900&path='.($path).'&original=1';
        else $stream='';
     
        include template('xiuxiu');  //调用模板文件
}
?>


说明
xiuxiu.htm
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Dzz系统框架

输入数据处理

数据DB层

安全相关

上传组件

评论组件

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }