【发布时间】:2015-01-24 22:04:11
【问题描述】:
我在将文件上传到“临时”文件夹时遇到问题。 这是上传te文件的mij代码
//GET RANDOM STRING FOR TEMP FOLDER ATTACHMENT
$randompath = $this->generateRandomString(20);
$config['upload_path'] = "./include/upload/temps/$randompath/";
$config['allowed_types'] = 'gif|jpg|png|pdf|tiff';
$config['max_size'] = '2048';
$config['max_width'] = '0';
$config['max_height'] = '0';
$config['remove_spaces'] = true;
$fullpath = $config['upload_path'] . $_FILES['attachment']['name'];
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('attachment'))
{
$cookie = array(
'name' => 'Attachment',
'value' => $fullpath
);
$this->input->set_cookie($cookie);
//return $fullpath;
return true;
}
else
{
return false;
}
我希望任何人都可以帮助我解决这个问题。 文件夹权限为 755 下面的代码也没有设置cookie
【问题讨论】:
-
什么问题?它会产生任何错误日志条目吗?
标签: php codeigniter file-upload