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

[eluser]malzahar[/eluser]
I'm inserting the other form data into a database and that appears to be working fine. Once the insert completes it goes to the upload code as shown below.

Code:
if($this->My_Data_Model->my_insert_function()) {
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";
}
}

After using $this->output->enable_profiler(TRUE); and viewing the post data it doesn't even show a value for $this->input->post('userfile') or in my $_FILES array so I'm not sure why the file isn't even being referenced.


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