标签:
public function Upload_上传图片() { $path = ‘/Upload/HuaHua/‘.date("Ymd"); Lee::mkFolder($_SESSION["APP_ROOT"].$path); $img = $_REQUEST[‘question_pic‘]; $img = str_replace(‘data:image/jpeg;base64,‘, ‘‘, $img); $img = str_replace(‘ ‘, ‘+‘, $img); $data = base64_decode($img); $file = $path .‘/‘.uniqid().‘.jpeg‘; $success = file_put_contents($_SESSION["APP_ROOT"].$file, $data); if($success) { return $_SESSION["STATIC_ROOT"].$file; } else { return null; } }
标签:
原文地址:http://www.cnblogs.com/CyLee/p/5559740.html