hi there, im a total newbie to php and i need some help on uploading a file to my server. basically ive taken the tutorial from html goodies and i cant get it to work. i have not got a clue. i have the code below can anyone possibly help me out, for a start i cant seem to see the code for where the files will be uploaded to (eg; home/username/area1/file, something along those lines). but like i said im a newbie and its probably staring me in the face :rolleyes:
——————-form.html——————————————-
<html>
<head>
<title>File Upload Form</title>
</head>
<body>
This form allows you to upload a file to the server.<br>
<form action=”getfile.php” method=”post”><br>
Type (or select) Filename: <input type=”file” name=”uploadFile”>
<input type=”submit” value=”Upload File”>
<input type=”hidden” name=”MAX_FILE_SIZE” value=”10000000″ />
</form>
</body>
———————getfile.php—————————————–
<html>
<head>
<title>Process Uploaded File</title>
</head>
<body>
<?php
if ( move_uploaded_file ($_FILES[‘uploadFile’] [‘tmp_name’],
“../uploads/{$
{ print ‘<p> The file has been successfully uploaded </p>’;
}
else
{
switch ($_FILES[‘uploadFile’] [‘error’])
{ case 1:
print ‘<p> The file is bigger than this PHP installation allows</p>’;
break;
case 2:
print ‘<p> The file is bigger than this form allows</p>’;
break;
case 3:
print ‘<p> Only part of the file was uploaded</p>’;
break;
case 4:
print ‘<p> No file was uploaded</p>’;
break;
}
}
?>
</body>
</html>
any help would be greatly apreciated
cheers
rik