我有一个大问题,我无法上传cakephp中的文件,我有一个错误:
if(!empty($this->request->data['Pictures']['name'])){
$foto_name=$this->request->data['Pictures']['name'];
$foto_tmp = $this->request->data['Pictures']['name']['tmp_name'];
$path=WWW_ROOT.'img'.DS.'myimage'.$foto_name;
move_uploaded_file($foto_tmp, $path);
}
而错误是:
Warning (2): Illegal string offset 'tmp_name'
我不明白为什么?
仅限使用
$temp_name = $this->request->data['Pictures']['tmp_name'];