[eluser]gmahesha[/eluser]
Hello everyone. i am new to CI.
i have problem in uploading the image. here is my code.
this is in the controller section
class Upload extends Controller {
function Upload()
{
parent::Controller();
$this->load->helper(array('form', 'url'));
}
function index()
{
$this->load->view('upload_form', array('error' => ' ' ));
}
function do_upload()
{
$config['file_path'] ='.system/uploads/';
//echo $config['file_path'];
$config['allowed_types'] = 'gif|jpg|jpeg|png|PNG';
$config['max_size'] = '900';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
$this->load->view('upload_success', $data);
}
}
}
this is the view part
<?php echo $error;?>
<?php echo form_open_multipart('upload/do_upload');?>
<input type="file" name="userfile" size="20" />
<br /><br />
<input type="submit" value="upload" />
</form>
After submitting the i8mage, it shows "The upload path does not appear to be valid."
i know, i have to set something in the Routes.php or in index.php (?). i dont know wat to set in these files? and where should i keep the uploads file ??
Anyone plz help me... Thanks in advance