I have created the form and script but just keep getting the above error - CAN ANYONE HELP!
This is the form:
<html>
<head>
<title>Upload a File</title>
</head>
<body>
<form enctype="multipart/form-data"
action="do_uploadmatt.php" method="POST">
<p><input type="hidden" name="MAX_FILE_SIZE" value="50000">
File to Upload: <input name="image" type="file"></p>
<p> Name for Uploaded File:<input name= "filename" type="text" id="filename" value="picture.jpg"></p>
<p><input type="submit" value="Upload!"></p>
</form>
</body>
</html>
This is the script:-
<?php
//Assign the entered filename to a variable
$filename = $_POST[filename];
//Specify the upload directory - assign to a variable
$uploaddir = '************/';
//Append the filename to the end of the upload directory
$uploadfile = $uploaddir . $filename;
//If upload is successful, print confirmation message
if (move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile))
{
echo "File is valid, and was successfully uploaded. <br>";
echo "Its name is <a href=$filename>$filename</a>";
}
else
{
echo "There was an error uploading the file.";
}
?>