【发布时间】:2014-11-12 10:04:20
【问题描述】:
当我在 localhost 中上传 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'];
【问题讨论】:
-
我打赌你在本地和服务器上没有相同的 apache 配置。
-
你可以显示错误,你可以从中得到更多的信息。
-
请放一些代码,这样会更容易帮助你
-
你能告诉我们你的代码和数据库中保存的数据吗
标签: php mysql file-upload xampp