This solution does not work because I guess there is some issue in the php.ini config.
I guess there are just 2 directives that interfere with file uploads - tmp_dir and open_base_dir
Max size is 2M , so I guess there are no issues.
I get the error right at $_FILES.
Array ( [userfile] => Array ( [name] => test.txt [type] => [tmp_name] => [error] => 6 [size] => 0 ) )
I am posting the code and this code works in one server but not the other.
_________________________________________________________________________
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Upload Test</title>
</head>
<body>
<form enctype="multipart/form-data" action="upldtest.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="99999999" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
</body>
</html>
<?php
$form_data = $_FILES['userfile']['tmp_name'];
print_r($_FILES);
//set the location
$base_name = $_SERVER['DOCUMENT_ROOT']."/uploads/".$form_data;
//move_uploaded_file($form_data, $base_name);
// upload the file to the server
if(copy($_FILES['userfile']['tmp_name'], $base_name)){
echo "upload successful";
}
else{
echo "Upload Failed";
}
?>
Any suggestions?