Welcome Guest, Not a member yet? Register   Sign In
Help!! I can upload anything with codeigniter
#1

[eluser]adekenny[/eluser]
Hi,

I really need help fast, there's this project i'm working on and i'm trying to incorporate a page that allows users to upload images to a directory. The problem is that it's just not working at all. I'v checked the code with the example on the user guide that there seems to be no problem with it.

When i clicked the upload buttom it just wasn't giving any response at all - no even any error message.

What are my not getting right?

please see my controller code below.



<?php

class Upload extends Controller
{

var $base;
var $css;
var $my_menu;

function Upload()
{
parent::Controller();
$this->base = $this->config->item('base_url');
$this->css = $this->config->item('css');
$this->load->library('menu');
$this->my_menu = $this->menu->show_menu();
$this->load->library('upload');
$this->load->library('session');
$this->load->helper(array('form', 'url'));
}


function do_upload()
{
if(!$this->upload->do_upload())
{
$data['menu'] = $this->my_menu;
$data['base'] = $this->base;
$data['css'] = $this->css;

$error = array('error' => $this->upload->display_errors());

$data['error'] = $error;
$this->load->view('photo_upload_failed', $data);
}
else
{
$data['menu'] = $this->my_menu;
$data['base'] = $this->base;
$data['css'] = $this->css;

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


$this->load->view('upload_success', $data);
}
}

}

?>


I've already created a file in my config folder where i set all the default settings. Please see below.

<?php

if(!defined('BASEPATH'))
{
exit;
}
else
{

$config['upload_path'] = 'uploads';

$config['allowed_types'] = 'gif|jpg|png';

$config['max_size'] = '40';

$config['max_width'] = '50';

$config['max_height'] = '60';

$config['remove_spaces'] = TRUE;
}

?>


Many Thanks
adekenny - Nigeria


Messages In This Thread
Help!! I can upload anything with codeigniter - by El Forum - 04-29-2010, 11:04 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-29-2010, 11:16 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-29-2010, 11:28 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-29-2010, 11:30 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-29-2010, 11:39 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-29-2010, 12:19 PM
Help!! I can upload anything with codeigniter - by El Forum - 04-29-2010, 03:24 PM
Help!! I can upload anything with codeigniter - by El Forum - 04-29-2010, 03:50 PM
Help!! I can upload anything with codeigniter - by El Forum - 04-30-2010, 02:57 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-30-2010, 06:59 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-30-2010, 07:09 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-30-2010, 09:51 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-30-2010, 09:56 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-30-2010, 10:02 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-30-2010, 10:12 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-30-2010, 10:22 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-30-2010, 10:29 AM
Help!! I can upload anything with codeigniter - by El Forum - 04-30-2010, 10:55 AM
Help!! I can upload anything with codeigniter - by El Forum - 05-01-2010, 05:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB