I saw that there were many posts for this subject, and so, here's a tip that might save you some time.
Use LOAD DATA INFILE when allowing clients to upload files files from their computer to load into the mysql database... NOT LOAD DATA LOCAL INFILE.
When using this you will notice that the newest versions of php, stips out the slashes from the filename and so mysql cannot find the file..... throwing an error.
Simply use addslashes($temp) before using the $temp as the location. // where temp is the temporary location of the file.
ie.
<form action="<?$PHP_SELF?>" method=post enctype="multipart/form-data">
<input type="file" name=userfile>
<input type=submit name=submit value=Submit>
</form>
if($submit == "Submit")
{
addslashes($userfile);
$query = "LOAD DATA INFILE '$temp' INTO TABLE products FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\r\n'";
$result = mysql_query($query);
}
This might save someone alot of frustration. ANYWAYS..... Hope it helps someone