title: How to upload excel file to php server from <input type="file">
body: <p>I want to upload excel file using  to php and wanted to perform some file operation in that excel file. I am not able to upload the file , If any one have some Idea please help , in the server side how to get the path from where the file has been uploaded?</p>
  
  <p>$target_dir = 'uploads/'; is not working for me. and My file is in D: Please help.</p>
  
  <p>PHP CODE:</p>
  
  <pre><code> &lt;?php    
  if(isset($_POST['SubmitButton'])){ //check if form was submitted
  
  $target_dir = 'uploads/';
  $target_file = $target_dir . basename($_FILES["filepath"]["name"]);
  $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
  
  require_once dirname(__FILE__) . '/Includes/Classes/PHPExcel/IOFactory.php';
  
  $inputFileType = PHPExcel_IOFactory::identify($target_file);
  
  $objReader = PHPExcel_IOFactory::createReader($inputFileType);
  $objPHPExcel = $objReader-&gt;load($target_file);
  
  $i=2;
  $val=array();
  $count=0;
  for($i=2;$i&lt;34;$i++)
  {
  $val[$count++]=$objPHPExcel-&gt;getActiveSheet()-&gt;getCell('C'.$i)-&gt;getValue();
  }
  //echo'&lt;pre&gt;';print_r($val);
  }    
  ?&gt;
  </code></pre>
  
  <p>HTML CODE:</p>
  
  <pre><code>&lt;body&gt;
  &lt;form action="" method="post" enctype="multipart/form-data"&gt;
  &lt;input type="file"  name="filepath" id="filepath"/&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="submit" name="SubmitButton"/&gt;
  &lt;/body&gt;
  </code></pre>