关于phpcms 中头像上传 那位高手说下怎么实现的

WBOY
Release: 2016-06-13 11:09:30
Original
782 people have browsed it

关于phpcms 中头像上传 那位高手说下如何实现的


图片在flash中提交过来的zip压缩包中,谁能告诉我,php是怎么获取到这个zip资源的?
------解决方案--------------------
phpsso_server\phpcms\modules\phpsso\classes\phpsso.class.php
第46行

<br />$this->data['avatardata'] = $GLOBALS['HTTP_RAW_POST_DATA'];<br />
Copy after login

post过来的数据。

file_pust_contents 根据数据,生成文件(包括文件地址)
你的代码没有贴完全

下面就是解压缩了
<br />//解压缩文件<br />		pc_base::load_app_class('pclzip', 'phpsso', 0);<br />		$archive = new PclZip($filename);<br />		if ($archive->extract(PCLZIP_OPT_PATH, $dir) == 0) {<br />			die("Error : ".$archive->errorInfo(true));<br />		}<br />		<br />		//判断文件安全,删除压缩包和非jpg图片<br />		$avatararr = array('180x180.jpg', '30x30.jpg', '45x45.jpg', '90x90.jpg');<br />		if($handle = opendir($dir)) {<br />		    while(false !== ($file = readdir($handle))) {<br />				if($file !== '.' && $file !== '..') {<br />					if(!in_array($file, $avatararr)) {<br />						@unlink($dir.$file);<br />					} else {<br />						$info = @getimagesize($dir.$file);<br />						if(!$info <br><font color='#FF8000'>------解决方案--------------------</font><br> $info[2] !=2) {<br />							@unlink($dir.$file);<br />						}<br />					}<br />				}<br />		    }<br />		    closedir($handle);    <br />		}<br />		$this->db->update(array('avatar'=>1), array('uid'=>$this->uid));<br />		exit('1');<br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template