Hi I am facing problem while uploading file. It gives me error -
Warning: open_basedir restriction in effect. File is in wrong directory in /usr/local/plesk/apache/vhosts/mahanandmilk.com/httpdocs/phpUpload.php3 on line 17
Please help me. I am giving my code also. Pl. help me...
<html>
<body>
<?
if (isset($users_file)) {
echo "<B>Remote File Name:</B> $users_file<BR>";
echo "<B>Local File Name:</B> $users_file_name<BR>";
echo "<B>Local File Size:</B> $users_file_size<BR>";
if (isset($users_file_type)) {
echo "<B>Local File Type:</B> $users_file_type<P>"; }
// Change $doc_directory to your 'DocumentRoot'.
$doc_directory ="/usr/local/plesk/apache/vhosts/mahanandmilk.com/httpdocs/";
$my_file = "tmp/uploaded-".$users_file_name;
$copy_path =$doc_directory.$my_file;
if ($users_file != "none") {
if(!copy($users_file, $copy_path)) {
echo "File upload failed!"; }
else { ?><A HREF="<? echo $my_file; ?>">Upload Complete!</A>
<? } }
else { echo "<P>You must select a file to upload!<P>"; ?>
<A HREF="<? echo $PHP_SELF; ?>"><B>Back</B></A> to the Upload Form
<? } }
else { ?>
<form action="<? echo $PHP_SELF; ?>"
enctype="multipart/form-data" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="20000" />
<input type="file" name="users_file" /><br />
<input type="submit" value="Upload!" />
</form><? } ?>
</body>
</html>

