Hi Experts,
I have a trouble in uploading files to server.
could u help me to sort out this issue.
My code is
<?
// you can change this to any directory you want
// as long as php can write to it
$uploadDir = 'E:\Resume';
if(isset($POST['upload']))
{
$fileName = $FILES['userfile']['name'];
$tmpName = $FILES['userfile']['tmp_name'];
$fileSize = $FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];
// the files will be saved in filePath
$filePath = $uploadDir . $fileName;
// move the files to the specified directory
// if the upload directory is not writable or
// something else went wrong $result will be false
$result = move_uploaded_file($tmpName, $filePath);
if (!$result) {
echo "Error uploading file";
exit;
}
include 'config-1.php';
include 'opendb.php';
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
$filePath = addslashes($filePath);
}
$query = "INSERT INTO upload2 (name, size, type, path ) ".
"VALUES ('$fileName', '$fileSize', '$fileType', '$filePath')";
mysql_query($query) or die('Error, query failed : ' . mysql_error());
include 'closedb.php';
echo "<br>File uploaded<br>";
}
?>
the error iam getting is
Warning: move_uploaded_file(E:\Resumeup.txt) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/sennall/public_html/Payroll/upload2.php on line 38
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpKqB0b6' to 'E:\Resumeup.txt' in /home/sennall/public_html/Payroll/upload2.php on line 38
Error uploading file
Please help me to sort out...
Thanks...