dimanche 12 avril 2015

codeigniter can't upload picture to folder

I need help to upload picture in folder. Here's the thing, I have 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, 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