require_once("/home/paluba/web/kub/www/library/fileupload-class.php");
//if ($_POST['submit']=='Submit') {
// 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(90000);
// OPTIONAL: if you're uploading images, you can set the max pixel dimensions
$my_uploader->max_image_size(150, 300); // max_image_size($width, $height)
// UPLOAD the file
// $my_uploader->upload($upload_file_name, $acceptable_file_types, $default_extension)
$success = $my_uploader->upload("userfile", "", ".jpg");
if ($success) {
// MOVE THE FILE to it's final destination
// $overwrite_mode = 1 :: overwrite existing file
// $overwrite_mode = 2 :: rename new file if a file
// with the same name already
// exists: file.txt becomes file_copy0.txt
// $overwrite_mode = 3 :: do nothing if a file with the
// same name already exists
$overwrite_mode=1;
$success = $my_uploader->save_file("/home/paluba/web/kub/www/upload/", $overwrite_mode);
};
/* if ($success) {
// Successful upload!
$file_name = $my_uploader->file['name'];
print($file_name . " was successfully uploaded!");
} else {
// ERROR uploading...
if($my_uploader->errors) {
while(list($key, $var) = each($my_uploader->errors)){
echo $var . "
";
};
};
*/
//}
//else {
?>