File: /home/www/fotospedroj/application/controllers/prueba.php
<?php
class Upload extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->helper(array('controlacceso','url','util','tiempo'));
$this->load->library('session', 'image_lib', 'form_validation');
$config['upload_path'] = './media/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '5000';
$config['max_width'] = '5024';
$config['max_height'] = '5768';
$this->load->library('upload', $config);
}
function do_upload() {
$this->upload->do_upload('Filedata');
$res = $this->upload->data();
echo $res['file_name'];
}
}