Location: PHPKode > scripts > xTem Upload > xtem-upload/xt_upload.php
<?

class xUpload {

      var $_file;
	  var $_dir;
	  var $_name;
	  var $_tname;
	  var $_rights;
	  
	  function make_dir($_dir, $_rights) {
	  $_doit = mkdir($_dir, $_rights);
	  if($_doit) echo "Making folder: Ok<br>";
	  else echo "Error while making folder<br>"; 
	  return $_doit;
	  }
	  
	  function change_dir($_dir) {
	  $_doit = chdir($_dir);
	  if($_doit) echo "Changing dir... OK<br>";
	  else echo "Error while changing dir<br>";
	  return $_doit;
	  }
	  
	  function upload_file($_file, $_name) {
	  $_doit = copy($_file, $_name);
	  if($_doit) echo "Uploading file: Ok<br>";
	  else echo "Error while uploading file<br>";
	  return $_doit;
	  }
	  
	  function make_thumb($_name, $_tname, $_width, $_height, $_del_source) {
	  
	   $groesse = getimagesize("$_name");

 
       $breite = $groesse[0];
       $hoehe  = $groesse[1];
 
       $neue_breite = $_width;
       $neue_hoehe  = $_height;
 
       $altes_bild = ImageCreateFromJPEG("$_name");
       $neues_bild = ImageCreateTrueColor($neue_breite, $neue_hoehe);
       ImageCopyResampled($neues_bild, $altes_bild, 0, 0, 0, 0, $neue_breite, $neue_hoehe,
                        $breite, $hoehe);

 				  
       $create_new = ImageJPEG($neues_bild, "$_tname");

       if($_del_source) {
        //Großes Bild löschen
        $del_upload = unlink("$_name");
		}
		
		return true;
	  
	  }
	  
	  function del_file($_name) {
	  $del_file = unlink("$_name");
	  if($del_file) echo "Deleting file $_name: OK<br>";
	  else echo "Error while deleting file $_name<br>";
	  
	  return $del_file;
	  }

}
?>
Return current item: xTem Upload