Welcome Guest, Not a member yet? Register   Sign In
[HELP] upload
#5

[eluser]C_Line[/eluser]
i already call it

this look like this

Code:
view
<form method="post" action="<?php echo base_url(). "index.php/main/updateBarang_admin/". $kode; ?>">
<tr><td align="center" >Gambar Barang  : </td><td>&lt;input type="file" name="upd_gbr_brg"&gt;&lt;/td></tr>

controller
function updBarang($kode)
{
$this->load->model('Query_barang','',TRUE);
$data['query'] = $this->Query_barang->ambildata_update($kode);
$data['kode'] = $kode;

$this->load->view('home_admin');
$this->load->view("updateFormBarang_admin",$data);
}

function updateBarang_admin($kode)
{
$this->load->model('Query_barang','',TRUE);
$data['query'] = $this->Query_barang->updateBarang($kode);
}

model
function updateBarang($kode)
{
$gambar = $this->input->post('upd_gbr_brg');
$nama = $this->input->post('upd_nm_brg');
$harga = $this->input->post('upd_hg_brg');
$stok = $this->input->post('upd_sk_brg');
$berat = $this->input->post('upd_brt_brg');
$tipe = $this->input->post('upd_tipe_brg');
$gambar = $this->input->post('upd_gbr_brg');
$status = $this->input->post('status_brg');
$config['upload_path'] = './gambar/';
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$config['max_size'] = '2000';
$config['max_width'] = '1920';
$config['max_height'] = '1280';

// You can give video formats if you want to upload any video file.

$this->load->library('upload', $config);

if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());

// uploading failed. $error will holds the errors.
}
else
{
$data = array('upload_data' => $this->upload->data());
}
}

why it display nothing and how to save the file i upload to my folder (gambar)


Messages In This Thread
[HELP] upload - by El Forum - 07-19-2012, 03:07 AM
[HELP] upload - by El Forum - 07-19-2012, 03:45 AM
[HELP] upload - by El Forum - 07-19-2012, 03:51 AM
[HELP] upload - by El Forum - 07-19-2012, 03:59 AM
[HELP] upload - by El Forum - 07-19-2012, 04:03 AM
[HELP] upload - by El Forum - 07-19-2012, 05:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB