//
// 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
// 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>";
$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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.