欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

小弟我的这个文件上传 类中的input里面的name为什么不能等于数组

程序员文章站 2022-04-08 22:50:38
...
我的这个文件上传 类中的input里面的name为什么不能等于数组?
class SyFile {
private $_upl_dir;
private $_refu_type;
private $_acce_type;
private $_errno = 0;
private $_ext;

public function __construct( $_upl_dir = '../upload', $size = 8388608 ) {
$this->_upl_dir = $_upl_dir;
if ( is_numeric( $_size ) ) @ini_set('upload_max_filesize',intval($_size));
$this->check_upload_dir();
}

/**
* set the accept file extension
* @param $acce_type;
*/
public function set_accept_type( $acce_type ) {
$this->_acce_type = $acce_type;
}
/**
* set the refuse file extension
* @param $refuse_type;
*/
public function set_refuse_type( $refuse_type ) {
$this->_refu_type = $refuse_type;
}

/**
* handing the files from the speicified file input .

* @param $name (the file input name )
* @param $over (if isn't overwrite the file)
*/
public function upload( $name,$_prefix = '', $over = true) {
$_error = $_FILES[''.$name.'']['error'];
$_local = $_FILES[''.$name.'']['name'];
$_temp = $_FILES[''.$name.'']['tmp_name'];
$_files = NULL;

$_size = count($_local);
if ( $_error != 0 ) return $_files;
$this->isLegal($_local);
if ( $this->_errno != 0 ) return $_files;
if ( $over && is_uploaded_file( $_temp ) ) {
$file = $this->generate( $_prefix );
if ( move_uploaded_file( $_temp, $this->_upl_dir.'/'.$file ) )
$_files = $file;
}
return $_files;
}
小弟我的这个文件上传 类中的input里面的name为什么不能等于数组

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频