title: PHP - Codeigniter : Uncaught exception 'PHPExcel_Reader_Exception' with message 'Could not open for reading, File does not exist
body: <p>My current CI project is now handling with files. i want to upload a xls| xlsx files to the server and then import excel file data into the Database table.</p>
  
  <p>as the first part , the file uploaded was successful, and i upload the files to the <strong>uploads</strong> folder in the same level of <strong>application , system, assets</strong> . now i want to load this file and import those contents to DB. I'm using <strong>PHPExcel</strong> to do this operation</p>
  
  <p>Here is my Controller </p>
  
  <pre><code>$this-&gt;load-&gt;library('phpexcel');
  $this-&gt;load-&gt;library('PHPExcel/iofactory');
  
  $objPHPExcel = new PHPExcel();
  
  $objReader= IOFactory::createReader('Excel2007');
  $objReader-&gt;setReadDataOnly(true);
  
  $objPHPExcel=$objReader-&gt;load(BASE_URL().'uploads/Data_Report.xls');
  
  $objWorksheet=$objPHPExcel-&gt;setActiveSheetIndex(0);
  
  $this-&gt;load-&gt;model('datas_model');
  
  for($i=2;$i&lt;=77;$i++) {
  
       $client_name= $objWorksheet-&gt;getCellByColumnAndRow(0,$i)-&gt;getValue();
       $client_address= $objWorksheet-&gt;getCellByColumnAndRow(1,$i)-&gt;getValue();
       $data_inp=array('name'=&gt;$client_name, 'address'=&gt;$client_address);
       $this-&gt;datas_model-&gt;add_data($data_inp);
     }
  </code></pre>
  
  <p>and here is my View</p>
  
  <pre><code>&lt;?php echo form_open_multipart('../settings_controller/upload_data/do_upload');?&gt;
  
     &lt;div class="custom-file-upload"&gt;
          &lt;input type="file" id="file" name="userfile" multiple/&gt;
     &lt;/div&gt;
     &lt;div class="button-container-2"&gt;
          &lt;button class="btn btn-primary" id="updown-btn" type="submit" style="height:45px;"&gt;Upload &lt;/button&gt;
     &lt;/div&gt;
  
  &lt;?php echo "&lt;/form&gt;"?&gt;
  </code></pre>
  
  <p>when I'm running it shows me an error <code>Uncaught exception 'PHPExcel_Reader_Exception' with message 'Could not open http://localhost/myproject/uploads/Data_Report.xls for reading! File does not exist.'</code></p>
  
  <p>when i put that Data_Report.xls file inside <strong>htdocs</strong> , it works succesfully .</p>
  
  <p>The problem is when im using BASE_URL().'uploads/Data_Report.xls'. but the file is physically there and i verified by pasting localhost/myproject/uploads/Data_Report.xls on url and it downloaded successfully.</p>
  
  <p>Any help would be greatly appreciated .</p>