title: ERROR: The upload destination folder does not appear to be writable
body: <p>Which file permission should I use for uploading and downloading files to a folder in codeigniter? </p>
  
  <p>My whole project is been hosted on FileZilla.  </p>
  
  <p>NOTE: Uploading downloading works perfectly fine when website is hosted loacally. </p>
  
  <p>Error only occurs when hosted through FileZilla.
  My Upload/Download folder is present in root directory of codeigniter (Directory where <strong>Application</strong> folder is present).  </p>
  
  <p><strong>Upload Controller Code</strong>  </p>
  
  <pre><code>public function do_upload(){  
  $rti_details['rtino'] = $this-&gt;input-&gt;post("rtino");
  
      $rtino_result = $this-&gt;rti_model-&gt;get_rti_details_by_rtino($rti_details['rtino']);
      if(!$rtino_result){ 
  
          $upload=$this-&gt;upload_file('rtifile',$this-&gt;input-&gt;post('rtino')); 
              if($upload)
              {
                  $data = array('rti_no'=&gt;$this-&gt;input-&gt;post('rtino'),
                            'filer_name'=&gt;$this-&gt;input-&gt;post('filername'),
                            'filer_add'=&gt;$this-&gt;input-&gt;post('fileradd'), 
                            'city'=&gt;$this-&gt;input-&gt;post('city'),
                            'state'=&gt;$this-&gt;input-&gt;post('state'),
                            'pin_code'=&gt;$this-&gt;input-&gt;post('pin_code'),
                            'rti_cat'=&gt;$this-&gt;input-&gt;post('rti_cat'),
                            'rti_file'=&gt;$upload['full_path'],
                            'filed_on'=&gt;$this-&gt;input-&gt;post('filedon')
                            );
  
              $this-&gt;rti_model-&gt;insert_rti($data);
              }
  
          $result = true;
      }
      else
          $result = false;
  
      if($result)
          $this-&gt;session-&gt;set_flashdata("flashSuccess","RTI added successfully");
      else
          $this-&gt;session-&gt;set_flashdata("flashError","Error in adding RTI. This RTI Number Already Exist.");
  
      redirect("rti/rti_file");
  </code></pre>
  
  <p>}  </p>
  
  <pre><code>private function upload_file($name ='',$sno = 0)
  {
      if($name=='rtifile'){   $config['upload_path'] = 'assets/rti_uploads/rti_file/';    }
      if($name=='coverletter'){   $config['upload_path'] = 'assets/rti_uploads/cover_letter/';    }
      if($name=='fullreply'){ $config['upload_path'] = 'assets/rti_uploads/full_reply/';  }
      $config['allowed_types'] = 'pdf';
      $config['max_size']  = '2050';
  
  
          if(isset($_FILES[$name]['name']))
          {
              if($_FILES[$name]['name'] == "")
                  $filename = "";
              else
              {
                  $filename=$this-&gt;security-&gt;sanitize_filename(strtolower($_FILES[$name]['name']));
                  $ext =  strrchr( $filename, '.' ); 
                  if($name=='rtifile'){   $filename='RTI_'.$sno.'_'.date('YmdHis').$ext;  }
                  if($name=='coverletter'){   $filename='COVER_'.$sno.'_'.date('YmdHis').$ext;    }
                  if($name=='fullreply'){ $filename='FULLREPLY_'.$sno.'_'.date('YmdHis').$ext;    }
              }
          }
          else
          {
              $this-&gt;session-&gt;set_flashdata('flashError','ERROR: File Name not set.');
              redirect('rti/rti_file');
              return FALSE;
          }
  
          $config['file_name'] = $filename;
  
          if(!is_dir($config['upload_path'])) 
          {
              mkdir($config['upload_path'],0777,TRUE);
          }
  
          $this-&gt;load-&gt;library('upload', $config);
          $this-&gt;upload-&gt;initialize($config);
  
          if ( ! $this-&gt;upload-&gt;do_upload($name)) 
          {
              $this-&gt;session-&gt;set_flashdata('flashError',$this-&gt;upload-&gt;display_errors('',''));
              redirect('rti/rti_file');
              return FALSE;
          }
          else
          {
              $upload_data = $this-&gt;upload-&gt;data();
              return $upload_data;
          }
  }
  </code></pre>