require("fileupload.class");
$email;
$desc;
#--------------------------------#
# Variables
#--------------------------------#
// The path to the directory where you want the
// uploaded files to be saved. This MUST end with a
// trailing slash unless you use $path = ""; to
// upload to the current directory. Whatever directory
// you choose, please chmod 777 that directory.
$path = "uploads/";
// The name of the file field in your form.
$upload_file_name = "userfile";
// ACCEPT mode - if you only want to accept
// a certain type of file.
// possible file types that PHP recognizes includes:
//
// OPTIONS INCLUDE:
// text/plain
// image/gif
// image/jpeg
// image/png
// Accept ONLY jpeg's
# $acceptable_file_types = "image/jpeg";
// Accept GIF and JPEG files
# $acceptable_file_types = "image/gif|image/jpeg";
// Accept ALL files
$acceptable_file_types = "";
// If no extension is supplied, and the browser or PHP
// can not figure out what type of file it is, you can
// add a default extension - like ".jpg" or ".txt"
$default_extension = "";
// MODE: if your are attempting to upload
// a file with the same name as another file in the
// $path directory
//
// OPTIONS:
// 1 = overwrite mode
// 2 = create new with incremental extention
// 3 = do nothing if exists, highest protection
$mode = 3;
#--------------------------------#
# PHP
#--------------------------------#
// Create a new instance of the class
$my_uploader = new uploader;
// OPTIONAL: set the max filesize of uploadable files in bytes
# $my_uploader->max_filesize(500000);
// OPTIONAL: if you're uploading images, you can set the max pixel dimensions
# $my_uploader->max_image_size(800, 800); // max_image_size($width, $height)
// UPLOAD the file
if ($my_uploader->upload($upload_file_name, $acceptable_file_types, $default_extension)) {
$success = $my_uploader->save_file($path, $mode);
}
if ($success) {
// Successful upload!
//$ip = getenv('REMOTE_ADDR');
$ip = $_SERVER["REMOTE_ADDR"];
//$ipname = getenv('REMOTE_HOST');
$ipname = $_SERVER["REMOTE_HOST"];
$file_name = $my_uploader->file['name']; // The name of the file uploaded
print($file_name . " was successfully uploaded!");
print(" ");
print_file($path . $file_name, $my_uploader->file["type"], 2);
$body = "http://biel.third-net.com/upload/uploads/$file_name\n\n$desc\n\nSent by: $email\nFrom: $ip\n";
// $body = "$file_name\n$desc\nSent by $email\nFrom $ip, hostname $ipname\n";
mail( "[email protected]", $file_name, $body, "From: $email\r\n" );
mail( "[email protected]", $file_name, $body, "From: $email\r\n" );
} else {
// ERROR uploading...
if($my_uploader->errors) {
while(list($key, $var) = each($my_uploader->errors)) {
echo $var . "
";
}
}
}
#--------------------------------#
# HTML FORM
#--------------------------------#
?>
";
} else {
echo " ";
}
}
}
?>
Important: If your picture doesn't display here after you've uploaded it, it means it didn't upload properly. If
you're sure the file is an image file (JPG or GIF), the problem may be with your browser (some versions of Internet Explorer,
for example, don't correctly identify the file type when uploading). If that happens, please try again with a different browser.
As a last resort, use the Feedback link on the front page to mail it.
Home
Hosted by Third-Net.Com