husin.anti husin.anti - 10 months ago 30
SQL Question

CI : You did not select a file to upload. error

okay, this is my controller :

public function buktisaldo(){
//load library
//Set the config
$config['upload_path'] = "./assets/images/campaigner/";
$config['allowed_types'] = "*";
//Upload file
if( !$this->upload->do_upload("bukti")){
//echo the errors
echo $this->upload->display_errors();
$data = array(
'bukti' => $this->upload->file_name
$id = $this->session->userdata('id');
$this->db->where('status','Sedang Diproses');

and this is my view :

<?php echo form_open('member/buktisaldo');?>
<input type="file" name="bukti">
<input type="submit" value="send">
<?php echo form_close();?>

and when i run this code, it shows error "You did not select a file to upload."

this is
script :

UPDATE `saldo` SET `bukti` = '' WHERE `id_user` = '74' AND `status` = 'Sedang Diproses'

it seems like my input name is wrong, but its correct, how to fix that ?


In Controller :

Change This

   $file_name = $this->upload->data('file_name'); 
   $data = array('bukti' => $file_name);

In View :

form should be like this :

<?php echo form_open_multipart('member/buktisaldo');?>