Here is a file that I found. It is comprehensive, and should work:
[tt]
<?
// QuickUploader
// Nagendra, nagendra@letterbox.com
// 10th Oct 2000 @ Mysore , India
// homepage :
// Released under GNU GENERAL PUBLIC LICENSE
//
// Directions to start cooking

//
// 1. start @ beginning of u r code and define a variable called $path ( ex : $path = "/home/httpd/html/suitesonline.com/"; )
// 2 .include the file upster.php ( ex : include ('upster.php'); )
// 3. print out a variable called $upl wherever u want to place QuickUploader code ( ex : echo "$upl";
//
// Change the Below $path to point to the dir which is the file area
// $path = "/var/tmp/";
// $path = "C:/temp/";
$the_path = $path;
if (!$path) {
echo "Path not defined or You are not authorised.";
exit;
}
if ($getty) {
// Code to Handle File Download
// Nagendra, nagendra@letterbox.com
// 20th Sept 2000 @ Mysore , India
$type="Content-type: application/cln";
// get the file & download to visitor
$filename = "$path$getty";
$fd = fopen ($filename, "r"

;
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
header("$type"

;
echo "$contents";
}
// Max File Size to be allowed...change this depending on users upload.. 100k~images/jpgs/gif/docs/etc
$my_max_file_size = "102400"; # in bytes
function validate_upload($the_file) {
global $my_max_file_size, $image_max_width, $image_max_height,$allowed_types,$the_file_type,$registered_types;
$start_error = "\n<b>Error:</b>\n<ul>";
if ($the_file == "none"

{
$error .= "\n<li>You did not upload anything!</li>";
} else {
list($foo,$width,$bar,$height) = explode("\"",$size[3]);
if ($error) {
$error = $start_error . $error . "\n</ul>";
return $error;
} else {
return false;
}
}
} # END validate_upload
function list_files() {
global $the_path;
$handle = dir($the_path);
}
function upload($the_file) {
global $the_path,$the_file_name;
$error = validate_upload($the_file);
if ($error) {
form($error);
} else { # or we can continue
// check if file exists, if then delete the old one before upload
$ffile = $the_path . '' . $the_file;
if ( file_exists("$ffile"

){
unlink ("$ffile"

;
};
// upload the actuall file here after all checks
if (!@copy($the_file, $the_path . "/" . $the_file_name)) {
form("\n<b>Something barfed, check u r path "

;
}
}
} # END upload
// HTML upload Form Gen.
$upl = <<<close
<form name="uplink" ENCTYPE="multipart/form-data" action="$PHP_SELF" method="post">
<b><font face="Arial, Helvetica, sans-serif" size="2">Quick Uploader</font></b><Br>
<INPUT NAME="the_file" TYPE="file" SIZE="5">
<INPUT TYPE="hidden" name="task" value="upload">
<input type="Submit" Value="Upload">
</form>
close;
// Delete File
if ($d)
{
unlink ("$path$d"

;
}
// Determine if file needs to be uploaded/downloaded/deleted
if ($task) {
upload($the_file);
}
if (!$title) {
$title = "Files List:";
}
$upl = $upl."\n<b>$title</b><br>";
$handle = dir($path);
$upl = $upl."<table width=\"28%\" border=\"0\">";
while ($file = $handle->read()) {
if (($file != "."

&& ($file != ".."

) {
$fsize = filesize ($path.$file);
$con = <<<giveup
<tr><td width="13%" height="2"><a href="$PHP_SELF?getty=$file" onMouseOver="drs('Size : $fsize Bytes'); return true;" onMouseOut="nd(); return true;">$file</a>
</td><td width="87%" height="2">
<a href="$PHP_SELF?d=$file">DELETE </a></td></tr>
giveup;
$upl = $upl."$con";
}
}
$upl = $upl."</table>";
?>
[/tt]
Hope this helps,
-Vic vic cherubini
malice365@hotmail.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====