Welcome Guest, Not a member yet? Register   Sign In
file upload controller
#1

[eluser]KrizzAngel[/eluser]
i cant get it to work Sad pls help.. here's my controller:
it keeps on saying "You did not select a file to upload."

Quote:
class admin extends Controller {

function admin(){
parent::Controller();
$this->load->helper('form');
}

function upload() {
$baseLoc= base_url();
$config['upload_path'] = $baseLoc."assets/Lessons/";
$config['allowed_types'] = 'swf|flv';
$chap = $this->input->post('chapnum');
$less= $this->input->post('lessnum');
$config['file_name'] = "lesson_".$chap;

$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('file'))
{
echo $this->upload->display_errors();
}
else
{
echo $this->upload->data();
}
}
}

and my view page:

Quote:<? echo form_open_multipart('admin/upload'); ?>
<input type="hidden" name="chapnum" value="<? echo $chapnumber; ?>" />
<input type="hidden" name="lessnum" value="<? echo $lessNum; ?>" />
<input type="file" name="vid" /><br />
<input type="submit" value="Next" />


Messages In This Thread
file upload controller - by El Forum - 02-13-2010, 02:55 AM
file upload controller - by El Forum - 02-13-2010, 03:04 AM
file upload controller - by El Forum - 02-13-2010, 03:44 AM
file upload controller - by El Forum - 02-13-2010, 07:17 AM
file upload controller - by El Forum - 02-13-2010, 08:11 AM
file upload controller - by El Forum - 02-13-2010, 08:15 AM
file upload controller - by El Forum - 02-13-2010, 08:38 PM
file upload controller - by El Forum - 02-14-2010, 04:43 AM
file upload controller - by El Forum - 02-14-2010, 06:56 AM
file upload controller - by El Forum - 02-14-2010, 07:15 AM
file upload controller - by El Forum - 02-16-2010, 08:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB