
I'm using Dreamweaver 8. The server running is Apache 2 with PHP 4.3.4.
After I click the submit button this is what I get:
Warning: move_uploaded_file(/conferinte/uploads/README.TXT): failed to open stream: No such file or directory in F:apachehtdocsconferintenew_abstract.php on line 60
Warning: move_uploaded_file(): Unable to move 'C:Tempphp5F7.tmp' to '/conferinte/uploads/README.TXT' in F:apachehtdocsconferintenew_abstract.php on line 60
...and the $_FILES['userfile'] array is this:
[name] => README.TXT
[type] => application/force-download
[tmp_name] => C:Tempphp5F7.tmp
[error] => 0
[size] => 2462
I've tried to make some changes in the php.ini file, I restarted the Apache server, but it seems that they ar ignored. Where should I place the php.ini file?
OR
What could be the solution?
P.S. - The code in the file ('new_abstract.php') is this:
<?php require_once('Connections/connConferinte.php'); ?>
<?php
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Conferinte</title>
<link href="CSS/main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
body {
background-color: #EFE9CF;
}
-->
</style>
</head>
<body>
<table width="800" height="50" border="0" cellpadding="0" cellspacing="0">
<tr>
<td scope="col"> </td>
</tr>
</table>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="10">
<tr>
<td width="140" height="355" valign="top" nowrap="nowrap" bgcolor="#FFCC99" scope="col"><?php require_once('meniu.php'); ?>
</td>
<td valign="top" scope="col">
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
if (isset ($_FILES['userfile']) /*|| true*/) {
$uploaddir = '/conferinte/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
echo '<pre>';
/* echo 'UploadDir = '.$cfg['UploadDir']."n";
echo 'upload_tmp_dir = '. $_SERVER['upload_tmp_dir']. "n";
echo 'upload_max_filesize = '. $_SERVER['upload_max_filesize']. "n";
*/ echo "Upload file = $uploadfilen";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.n";
} else {
echo "Possible file upload attack!n";
}
echo "Here is some more debugging info:n";
print_r($_FILES);
print_r($_SERVER);
print "</pre>";
}
else {
?> <!-- The data encoding type, enctype, MUST be specified as below -->
<form enctype="multipart/form-data" action="<?php echo $editFormAction; ?>" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<!-- Name of input element determines name in $_FILES array -->
Send this file:
<input type="file" name="userfile" />
<input type="submit" value="Send File" />
</form>
<?php
}
?>
</td>
</tr>
</table>
<p> </p>
</body>
</html>