samedi 11 avril 2015

codeigniter can't upload picture to folder

need help upload picture to folder, here's the thing, ive tested before and it worked, after a while i test this again and boom it doesn't work, i really can;t think straight here, wanna mad, please help


my view :



<?php
echo form_open_multipart("adminFolder/admin/insert_picture");

echo form_upload("userfile", "Gambar Picture");

echo form_submit("input_picture", "Input now !!!");

?>


my controller :



public function insert_picture(){
$this->model_get->doUpload();
}


my model :



function doUpload(){
$path = './assets/images/';
chmod($path, 0777);

$config['upload_path'] = $path;
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['max_size'] = '6000';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$config['overwrite'] = TRUE;

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

if(!$this->upload->do_upload()){
redirect("adminFolder/admin/insertPicture");
}else{

redirect("adminFolder/admin/adminPic");
}


}

Aucun commentaire:

Enregistrer un commentaire