Welcome Guest, Not a member yet? Register   Sign In
Error uploading file pdf
#2

You made some misconfiguration in upload method code,
  1. `upload_url` not any config type in upload library.
  2. `max_size` value by default in KB not need to add in value
  3. better to use more Upload library functions.
  4. you should create ./upload directory on project root folder and use `FCPATH` constant to go folder location.

see below correct sample code

PHP Code:
function uploadFile() {
 
   $config['upload_path'] = FCPATH "/upload/";
 
   $config['allowed_types'] = "pdf";
 
   $config['overwrite'] = TRUE;
 
   $config['max_size'] = "1000";
 
   $config['file_name'] = "namearchivo";
 
   $this->load->library('upload'$config);

 
   if ($this->upload->do_upload()) {
 
       $file_data $this->upload->data();
 
       $file_name $file_data['file_name'];
 
       redirect($urlAnterior);
 
   } else {
 
       echo $this->upload->display_errors('<p>''</p>');
 
       //redirect($urlAnterior);
 
   }


Probably solution would be work for you  Smile
Passionate PHP Programmer & Codeigniter Developer :- Always happy to help you!
Reply


Messages In This Thread
Error uploading file pdf - by gloton - 03-19-2015, 06:30 PM
RE: Error uploading file pdf - by techbat - 03-19-2015, 10:46 PM
RE: Error uploading file pdf - by Avenirer - 03-20-2015, 12:53 AM
RE: Error uploading file pdf - by gloton - 03-22-2015, 09:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB