Jacobb123
05-16-2008, 12:40 AM
I have a script running in the public_html/admin directory and It is trying to upload to the public_html/documents directory I have the following code:
$uploaddir="../documents";
$uploaddirurl = "http://uvfmusic.com/xpress/documents";
$resimadi = $_FILES['userfile']['name'];
$uploadfile ='"' . $uploaddir.'/'. $resimadi . '"';
$tags=$_POST['tags'];
$description=$_POST['description'];
$doc_title=$_POST['doc_title'];
$instruments=$_POST['instrument'];
$tempo=$_POST['tempo'];
$genre=$_POST['genre'];
$sounds=$_POST['sounds_like'];
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir);
//$query = "INSERT INTO `files` (`id`,`file_name`,`file_path`,`tags`,`description`,`doc_name`,`genre`,`instrument`,`sounds_like`,`te mpo`) VALUES(NULL,'$resimadi','$uploaddirurl','$tags','$description','$doc_title','$genre','$instruments', '$sounds','$tempo')";
//echo $query;
//mysql_query($query) or die(mysql_error());
echo "<center><br><h1><a href=\"$uploaddir/$resimadi\">$resimadi</a> File was uploaded</h1><br><br><a href=\"javascript:history.go(-1);\"><< Back </a></center>\n";
}
It keeps throwing the following error:
Warning: move_uploaded_file(../documents): failed to open stream: Is a directory in /home/content/s/a/h/sahiaman/html/xpress/admin/doc_add.php on line 61
Warning: move_uploaded_file(): Unable to move '/tmp/php54FlTN' to '../documents' in /home/content/s/a/h/sahiaman/html/xpress/admin/doc_add.php on line 61
$uploaddir="../documents";
$uploaddirurl = "http://uvfmusic.com/xpress/documents";
$resimadi = $_FILES['userfile']['name'];
$uploadfile ='"' . $uploaddir.'/'. $resimadi . '"';
$tags=$_POST['tags'];
$description=$_POST['description'];
$doc_title=$_POST['doc_title'];
$instruments=$_POST['instrument'];
$tempo=$_POST['tempo'];
$genre=$_POST['genre'];
$sounds=$_POST['sounds_like'];
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir);
//$query = "INSERT INTO `files` (`id`,`file_name`,`file_path`,`tags`,`description`,`doc_name`,`genre`,`instrument`,`sounds_like`,`te mpo`) VALUES(NULL,'$resimadi','$uploaddirurl','$tags','$description','$doc_title','$genre','$instruments', '$sounds','$tempo')";
//echo $query;
//mysql_query($query) or die(mysql_error());
echo "<center><br><h1><a href=\"$uploaddir/$resimadi\">$resimadi</a> File was uploaded</h1><br><br><a href=\"javascript:history.go(-1);\"><< Back </a></center>\n";
}
It keeps throwing the following error:
Warning: move_uploaded_file(../documents): failed to open stream: Is a directory in /home/content/s/a/h/sahiaman/html/xpress/admin/doc_add.php on line 61
Warning: move_uploaded_file(): Unable to move '/tmp/php54FlTN' to '../documents' in /home/content/s/a/h/sahiaman/html/xpress/admin/doc_add.php on line 61