Welcome Guest, Not a member yet? Register   Sign In
File Upload Help
#1

[eluser]malzahar[/eluser]
I'm having trouble getting file uploads to work with my form. I made sure the upload folder permissions are correct (755) and the library looks to be configured properly but when I try to do an upload it just fails but does not return any errors. If anyone could take a look at this for me it would be much appreciated.

Parts of the form that matters.
Code:
echo form_open_multipart('form/form_validate', $attributes);
echo form_upload('userfile');
echo form_submit('submit', 'Submit');
echo form_close();

Part of the controller that matters
Code:
function form_validate() {
//some validation rules none that apply to the file upload
if($this->form_validation->run() == TRUE) {
$config = array(
     'allowed_types' => 'jpg|jpeg|pdf',
     'upload_path' => realpath(APPPATH . '../uploads/'),
     'max_size' => 1500,
);
$this->load->library('upload', $config);
if(!$this->upload->do_upload('userfile')) {
     echo "failed to upload";
     echo $this->upload->display_errors('<p>', '</p>');
}
else {
     echo "file uploaded";
}
}


Messages In This Thread
File Upload Help - by El Forum - 08-08-2012, 06:43 AM
File Upload Help - by El Forum - 08-08-2012, 07:12 AM
File Upload Help - by El Forum - 08-08-2012, 07:14 AM
File Upload Help - by El Forum - 08-08-2012, 07:28 AM
File Upload Help - by El Forum - 08-08-2012, 08:06 AM
File Upload Help - by El Forum - 08-08-2012, 08:08 AM
File Upload Help - by El Forum - 08-08-2012, 08:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB