二进制文件上传类demo:
<?php
/**
* 二进制图片上传类
*/
class UpImg{
//文件的目录
protected $updir;
//文件的类型
protected $type;
/**
* 构造方法
*/
public function __construct($updir = '', $type = 'jpg'){
$curdir = getcwd().DIRECTORY_SEPARATOR;
$this->updir = empty($updir) ? $curdir.'uploads'.DIRECTORY_SEPARATOR : $curdi