W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
<?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){ //覆蓋原有文件
//獲取文件內(nèi)容
$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); //上傳文件到服務(wù)器
if(empty($re['error'])){
$icoarr=$re['icoarr'][0];
}else{
$icoarr=$re;
}
}
echo json_encode($icoarr); //返回
exit();
}else{
$path=rawurldecode($_GET['path']); //根據(jù)文件路徑打開文件
if($path) $stream=$_G['siteurl'].DZZSCRIPT.'?mod=io&op=thumbnail&width=1440&height=900&path='.($path).'&original=1';
else $stream='';
include template('xiuxiu'); //調(diào)用模板文件
}
?>
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: