Can not open file using LOAD DATA INFILE
Posted: Fri Aug 05, 2011 5:33 pm
Trying to upload from a temp directory uploaded using $_POST $_FILES for what ever reason I'm getting the following error message:
for which the output to the web page is:
[text]
temp_uploads/tester_feet_CVS.csv
drawback
TESTER_FEET
you are connected
you have selected a database and table
/var/www/drawback.com
Can't get stat of '/var/lib/mysql/temp_uploads/tester_feet_CVS.cvs' (Errcode: 2)
[/text]
Made the temp_uploads file myself and gave it 777 privilages. can browse to the uploaded file no problem.
Anyone know what is going on here?
the code on that page is the following:Can't get stat of '/var/lib/mysql/temp_uploads/tester_feet_CVS.cvs' (Errcode: 2)
Code: Select all
<!DOCTYPE html>
<?php session_start();?>
<html>
<head>
<meta charset="utf-8" />
<title><?php echo $title; ?></title>
</head>
<body>
<?php
echo $_SESSION['target_path']."<br/>".$_SESSION['database_selected']."<br/>".$_SESSION['database_table_selected']."<br/>"."<br/>";
?>
<?php $result = mysql_connect('localhost','root','qwerty123');
if($result) {
echo "you are connected"."<br/>";
}
else {
echo "you are not connected". mysql_error();
}
?>
<?php
mysql_select_db("".$_SESSION['database_selected']."");
$result = mysql_query("SELECT * FROM ".$_SESSION['database_table_selected']."");
if (!$result) {
die('Query failed: ' . mysql_error());
}
else {
echo "you have selected a database and table"."<br/>";
}
?>
<?php
echo getcwd()."<br/>";
$uploadalready="LOAD DATA INFILE 'temp_uploads/tester_feet_CVS.cvs' INTO TABLE TESTER_FEET FIELDS TERMINATED BY ','";
mysql_query($uploadalready) or die(mysql_error());
?>
</body>
</html>[text]
temp_uploads/tester_feet_CVS.csv
drawback
TESTER_FEET
you are connected
you have selected a database and table
/var/www/drawback.com
Can't get stat of '/var/lib/mysql/temp_uploads/tester_feet_CVS.cvs' (Errcode: 2)
[/text]
Made the temp_uploads file myself and gave it 777 privilages. can browse to the uploaded file no problem.
Anyone know what is going on here?