[eluser]raiser[/eluser]
Dear Friends,
I tried to upload image.. But couldn't do it.. I followed the user guide to upload. But somewhere i did some mistake. I cannot find it.. Kindly help me.. My code is,
View:
Code:
<?php echo form_open_multipart(''); ?>
<table width="866" height="100%" border="1" align="center" cellpadding="0" cellspacing="0" style="border:3px solid #FFFFFF;">
<tr>
<td width="23%" height="40" class="list_conents">Upload Image </td>
<td width="5%" height="40" class="list_conents">:</td>
<td width="72%" height="40"><input type="file" name="page_img" id="page_img" size="40" class="browse_file"/></td>
</tr>
<tr>
<td height="39"> </td>
<td> </td>
<td><input type="submit" name="submit" value="Submit" class="submit2"> <input type="reset" value="Reset" class="submit2" /></td>
</tr>
</table>
Controller:
Code:
class Events_awards extends CI_Controller{
public function _construct()
{
parents::_construct();
}
function index()
{
$config['upload_path'] = './assets/images/news_events/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '0';
$config['max_width'] = '0';
$config['max_height'] = '0';
$this->load->library('upload', $config);
redirect('events_awards/add_event');
}
}