<?php   

/**
 *      【TuntronJxt v4.0】 (C)2010-2012 Tuntron Inc.
 *      
 *    	http://www.tuntron.com   QQ：1121251729
 *		
 *      &头像上传文件&
 */
 
 
define('IS_RUN', TRUE);
define('DEBUG', FALSE);
define('TUNTRON_PATH', getcwd());
define('TUNTRON_INC', TUNTRON_PATH.'/include');
define('TUNTRON_DAT', TUNTRON_PATH.'/dat');
ob_start();

//加载核心文件
require TUNTRON_INC.'/init.php';

if(_post('png1')){
	
$somecontent1=base64_decode(_post('png1'));   
$somecontent2=base64_decode(_post('png2'));  
$somecontent3=base64_decode(_post('png3'));    

$filename120 = TUNTRON_DAT."/upload/user/".$_CO['username'].'_'.$_CO['uid']."/".$_CO['username']."_120.jpg"; 
$filename48 = TUNTRON_DAT."/upload/user/".$_CO['username'].'_'.$_CO['uid']."/".$_CO['username']."_48.jpg"; 
$filename24 = TUNTRON_DAT."/upload/user/".$_CO['username'].'_'.$_CO['uid']."/".$_CO['username']."_24.jpg";
$dir = TUNTRON_DAT."/upload/user/".$_CO['username'].'_'.$_CO['uid']."/";
makedir($dir);
if($handle=fopen($filename120,"w+")) 
{   
	if(!fwrite($handle,$somecontent1)==FALSE)
	{   
		fclose($handle);
	}
}  

if($handle=fopen($filename48,"w+"))
{   
	if(!fwrite($handle,$somecontent2)==FALSE) 
	{   
		fclose($handle);  
	}
} 

if($handle=fopen($filename24,"w+"))
{   
	if(!fwrite($handle,$somecontent3)==FALSE)
	{   
		fclose($handle);  
	}
}

echo "success=上传成功";
}else{
	
	die('Forbidden');
	
}
?>