title: cannot upload csv file and get error C:\xampp\tmp\php9F4F.tmp
body: <p>I'm working on a website that required me to create function to upload .csv file.
  When upload the file, it says wrong format, and it display this message:</p>
  
  <blockquote>
    <p>C:\xampp\tmp\php9F4F.tmp</p>
  </blockquote>
  
  <p>p/s:I already convert the excel file into .csv comma delimited format and still get error while uploading.</p>
  
  <p><strong>What should I do to resolve the error and then get to upload the csv file into my database?</strong></p>
  
  <p>stdreport.php : //im using the same code from import.php in here to connect it with database</p>
  
  <pre><code>&lt;?php
  $SQLSELECT = "SELECT stdCard, stdName, stdProgram, stdCourseDesc, stdCampus 
                  FROM student 
                  ORDER BY stdID 
                  LIMIT 0,20";
  
  $result_set =  mysql_query($SQLSELECT, $conn);
  while($row = mysql_fetch_array($result_set))
  {
  ?&gt;
  </code></pre>
  
  <p>import.php</p>
  
  <pre><code>&lt;?php 
  $conn=mysql_connect("localhost","root","") or die("Could not connect");
  mysql_select_db("dashboard",$conn) or die("could not connect database");
  
  if(isset($_POST["Import"])){
  
      echo $filename=$_FILES["file"]["tmp_name"];
  
      if($_FILES["file"]["size"] &gt; 0) {
  
          $file = fopen($filename, "r");
          while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE) {
  
              //It wiil insert a row to our subject table from our csv file`
              $sql = "INSERT into student 
                              (`stdID`, `stdCard`, `stdName`, 
                              `stdOfficialEmail`,`stdEmail`, 
                              `stdContNum`,`stdCourseDesc`, `stdCampus`, 
                              `accessDate`) 
                      values('$emapData[1]','$emapData[2]','$emapData[3]',
                              '$emapData[4]','$emapData[5]',
                              '$emapData[6]', '$emapData[7]','$emapData[8]',
                              '$emapData[9]')";
  
              //we are using mysql_query function. it returns a resource on true else False on error
              $result = mysql_query( $sql, $conn );
              if(! $result ) {
                  echo "&lt;script type=\"text/javascript\"&gt;
                          alert(\"Invalid File:Please Upload CSV File.\");
                          window.location = \"stdreport.php\"
                      &lt;/script&gt;";
              }
          }
          fclose($file);
          //throws a message if data successfully imported to mysql database from excel file
          echo "&lt;script type=\"text/javascript\"&gt;
                  alert(\"CSV File has been successfully Imported.\");
                  window.location = \"stdreport.php\"
              &lt;/script&gt;";
  
               //close of connection
              mysql_close($conn); 
           }
      }    
  ?&gt;       
  </code></pre>