当我在本地主机中上传一个 csv
文件时,它可以正常工作。所有验证都已完成,但在线上传文件时无法正常工作。文件正在刷新。这是我的示例代码
$data['error'] = ''; //initialize image upload error array to empty
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'csv';
$config['max_size'] = '10000';
$this->load->library('upload', $config);
if (!$this->upload->do_upload())
{
$data['error'] = $this->upload->display_errors();
$data['mainpage']='category';
$data['mode']='addcsv';
$this->load->view('includes/mainpage',$data);
}
else
{
$file_data = $this->upload->data();
$file_path = './uploads/'.$file_data['file_name'];
最佳答案
请检查您对要上传的目录的写权限。
关于PHP文件上传在本地工作但不在服务器上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25906324/