我有一个大问题,我无法在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'
我不明白为什么?
答案 0 :(得分:0)
仅限使用
$temp_name = $this->request->data['Pictures']['tmp_name'];