I want to create a simple script for uploading files from local maschine (windows) to a web servers (linux) directory.
I found on the net some example codes and make the two parts of that simple script.
1. The HTML form creation...
<html>
<body>
<form enctype="multipart/from-data" action="upload.php" method="POST">
Choose a file: <input name="uploaded" type="file" /><br />
<input type="submit" value="Upload" />
</form>
</body>
</html>
2. ...which calls the upload.php script
<?php
$target='/srv/www/htdocs/www/';
$target= $target . basename($_FILES['uploaded']['name']);
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "File". basename($_FILES['uploadedfile']
['name']). "uploaded succesfully";
}
else
{
echo "An error occured";
}
?>
I get "An error occured" message while trying to upload something.
I might have also problems with the file permission in linux.
I create a ./upload/ directory in the www root and I don't exactly know who should be the owner of that directory and in what group it should be. I tried the user and group wich is udsed for apache.
Can anyone help please?