1 回答
TA贡献1830条经验 获得超3个赞
我不知道为什么在关闭我的笔记本电脑并稍微更改代码后会起作用,所有大尺寸的文件都可以上传和下载 ofc 我更改了 Stackoverflow 上一些像我一样有问题的用户的代码,谢谢
我认为这个可以使上传的 pdf 起作用,我更改了这一行
$config ['allowed_types'] = '*';
这是上传文件的更新,我只改变了这个功能
$id_car_header = $this->input->post('input_id_car_header');
$keterangan = $this->input->post('input_keterangan');
$arsip = $_FILES["input_arsip"]['name'];
$config ['allowed_types'] = '*';
$arsip_generate =$_FILES["input_arsip"]['name'];
$config ['upload_path'] = './uploads';
$config['file_name'] = $arsip_generate;
$config['max_size'] = 2000000;
$config['max_width'] = 1500;
$config['max_height'] = 1500;
$this->load->library('upload', $config);
$this->upload->initialize($config, true);
//$this->upload->initialize($config);
if (!$this->upload->do_upload('input_arsip'))
{
$error = array('error' => $this->upload->display_errors());
$this->upload->display_errors();
//$this->upload->display_errors()
echo "Gambar Gagal DiUpload..!!";
var_dump($config);
} else{
$arsip = $this->upload->data('file_name');
$data = array
(
'id_car_header' => $id_car_header,
'ket_arsip' => $keterangan,
'datas' => $arsip
);
$check = $this->m_db->insertDataAll("tbl_car_arsip", $data);
$this->checkInsert($check);
}
- 1 回答
- 0 关注
- 63 浏览
添加回答
举报