title: Code Igniter : error in reading .xslx file (file is not readable)
body: <p>------------------ error -----------------------------</p>
  
  <pre><code>The filename ./upload/1407500591-CI1.xlsx is not readable
  </code></pre>
  
  <hr>
  
  <p>------------------- details--------------------------</p>
  
  <h2>when I try to upload file, it uploads in ./upload directory. but when I try to read file it gives error like it is not READABLE. Thanks in advance.</h2>
  
  <p>-------------- controller ----------------------------</p>
  
  <pre><code>public function import_data()
  {
      if($_POST['sheet_name'])
      {
          $values=$this-&gt;validate($_POST);
          if(isset($_FILES))
          {
              $config['upload_path'] = './upload/';
              $config['allowed_types'] = 'xlsx';
              $config['max_size'] = '100000';
              $config['file_name'] = time().'-'.$_POST['sheet_name'];
              $this-&gt;load-&gt;library('upload', $config);
              $this-&gt;upload-&gt;initialize($config); 
              if (!$this-&gt;upload-&gt;do_upload()) {
                  echo $error = $this-&gt;upload-&gt;display_errors();
          }       
          $req['image_url']=$this-&gt;upload-&gt;do_upload();
          $this-&gt;excel_reader-&gt;read('./upload/'.$req['image_url']);
  
              // Get the contents of the first worksheet
                  $worksheet = $this-&gt;excel_reader-&gt;sheets[0];
                  //print_r($worksheet);
                  //$data = new Spreadsheet_Excel_Reader($config['file_name']);
  
                  $numRows = $worksheet['numRows']; // ex: 14
                  $numCols = $worksheet['numCols']; // ex: 4
                  $cells = $worksheet['cells']; // the 1st row are usually the field's name
                  //print_r($cells );
                  $rowCount = count($cells);
                  $data['sheet_id']=$this-&gt;profile_model-&gt;createDatasheet($values);   
                  $data['data_id']=-1;
                  for($i=2;$i&lt;=$rowCount;$i++) 
                  {
                  $data["profile_picture"]= isset($cells[$i][1]) ? $cells[$i][1] : '';
  
                  $data["name"] = isset($cells[$i][2]) ? $cells[$i][2] : '';
                  $data["country"]= isset($cells[$i][3]) ? $cells[$i][3] : '';
                  $data["city"]= isset($cells[$i][4]) ? $cells[$i][4] : '';
                  $data["email"]= isset($cells[$i][5]) ? $cells[$i][5] : '';
                  $data["skype"]= isset($cells[$i][6]) ? $cells[$i][6] : '';
                  $data["phone"]= isset($cells[$i][7]) ? $cells[$i][7] : '';
                  $data["star_rating"]= isset($cells[$i][10]) ? $cells[$i][10] : '';
                  $data["hourly_rate"]= isset($cells[$i][11]) ? $cells[$i][11] : '';
                  $data["tag_line"]= isset($cells[$i][12]) ? $cells[$i][12] : '';
                  $data["description"]= isset($cells[$i][8]) ? $cells[$i][8] : '';
  
  
                          $req['sheet_data_id']=$this-&gt;profile_model-&gt;insertDatasheetItems($data);    
  
                  }       
  
                                  //$req['image_url']=$data['website_name']."/i".$data['sheet_id']."/$count-".time().$path_parts['basename'];
  
                                  //$this-&gt;save_image($file,$config['upload_path'].$req['image_url']);                            
                                  $this-&gt;profile_model-&gt;insertDatasheetImages($req);
  
                  redirect('/modify/user_scrape_data_display/'.$data['sheet_id']);
              }
          }
      }
  </code></pre>
  
  <hr>