<?php
class UploadModel extends Model{
        public function up($is_goods = false){
			import('ORG.Net.UploadFile');
			$upload = new UploadFile();// 实例化上传类
			$upload->maxSize  = C('store_imgsize') ;// 设置附件上传大小
			$upload->allowExts  = array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型
			$upload->savePath =  __ROOT__.'uploads/images/';// 设置附件上传目录
			if($is_goods == true) {
			$upload->thumb = true;
			$upload->thumbMaxWidth = C('store_imgthumb_weight');
			$upload->thumbMaxHeight = C('store_imgthumb_height');
			$upload->thumbPrefix = C('store_imgthumb_prefix');
			}
			$upload->autoSub=true;
			$upload->subType='date';
			if(!$upload->upload()) {// 上传错误提示错误信息
			// $this->error($upload->getErrorMsg());
			}else{// 上传成功 获取上传文件信息
			$info =  $upload->getUploadFileInfo();
			}
			return $info?$info:false;
		}
	}