This little barebones script will do the trick. This has no error checking and is very simple.
<?php
if ($Submit) {
/ set this variable to the unix path where your uploaded files will be living /
/ Remember the trailing slash /
$upload_path = "/home/yoursite/www/uploads/";
/ set this variable to the html path where your index file for where your uploaded files live /
$uploads_path = "http://www.yoursite.com/uploads/" . $userfile_name;
$loc = $upload_path . $userfile_name;
if (copy($userfile, $loc)) {
$done = 1;
} else {
$done = 0;
}
unlink($userfile);
}
?>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<form action="<?php print $PHP_SELF; ?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
<input type="file" name="userfile">
<br>
<br>
<input type="submit" name="Submit" value="Submit">
</form><br><br>
<?php if ($done == 1) { ?>
Upload Good<br>
<a href="<?php print $uploads_path; ?>">Uploads folder</a>
<?php } else { ?>
Error
<?php } ?>
</body>