Uploader CodeIgniter Error file Type
Halo sahabat,
Apakah anda mengalami permasalahan yang sama seperti yang pernah saya alami? hehe
saya mencari “how to fix” problem ini dari berbagai sumber baik dari stackoverflow dsb, namun error pada uploader CI ini adalah berada pada salah satu file di “DIR” system.
apakah pesan errornya “The file type you are attempting to upload is not allowed” ? Jika benar teruskan membaca postingan ini mudah-mudahan dapat membantu permasalahan yang sedang anda alami, karena saya merasakan betapa bingungnya mengatasi error pada script code apalagi waktunya sudah mepet dengan deadline 😀
oke langsung saja ya 🙂
Buka dir “SYSTEM” cari upload.php
nah disinilah letak error yang harus kita perbaiki,
cari kode :
@exec(‘file –brief –mime-type ‘ . escapeshellarg($file[‘tmp_path’]), $output, $return_code);
Replace dengan
@exec(‘file –brief –mime-type ‘ . escapeshellarg($file[‘tmp_name’]), $output, $return_code);
Lalu cari lagi kode berikut :
$this->file_type = @mime_content_type($file[‘tmp_name’]);
return;
Replace Dengan :
$this->file_type = @mime_content_type($file[‘tmp_name’]);
if (strlen($this->file_type) > 0) return;
Lalu cari lagi kode berikut :
$ext = strtolower(ltrim($this->file_ext, ‘.’));
if ( ! in_array($ext, $this->allowed_types))
{
return FALSE;
}
Replace Dengan :
$ext = strtolower(ltrim($this->file_ext, ‘.’));
if ( ! in_array($ext, $this->allowed_types))
{
die(var_dump($ext));
return FALSE;
}
Semoga membantu 🙂
kalau errornya sudah teratasi tinggalkan jejak di komentar 😉
Tags: The file type you are attempting to upload is not allowed, tidak bisa upload codeigniter, uploader code igniter error
Leave a Reply