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 關注
- 87 瀏覽
添加回答
舉報