[eluser]gafroninja[/eluser]
Hey Guys,
Yup you've guessed it, I have an issue with the file upload class. I'm sorry to bother people about it, but I feel I'm missing something and can't for the life of me figure it out. I've set the folders chmod 777.
view:
Code:
<?= form_open_multipart('admin/page_update/'); ?>
<fieldset>
<h3>Page Content</h3>
<p>
<label for="userfile">Main Image</label>
<input type="file" name="userfile" size="20" />
</p>
</fieldset>
<p>
<input type="submit" value="upload" />
</p>
</form>
controller:
Code:
function page_update()
{
$this->pages_model->doImageUpload();
}
model:
Code:
var $pageImagePath;
var $pageImagePathUrl;
function Pages_model()
{
parent::Model();
$this->pageImagePath = realpath(APPPATH . '../images/pages');
}
function doImageUpload()
{
$config = array(
'upload_types' => 'jpg|jpeg|gif|png',
'upload_path' => $this->pageImagePath
);
$this->load->library('upload', $config);
$this->upload->do_upload();
}
The form does more, but ive removed all the excess to get this working. I hope you guys can help.
Thanks in advanced guys and gals.
Cheers,
Darren