Re: Re: Multiple Uploads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> well, something exactly ;-)
>
> sorry
>

<?PHP

/*
# Copyright (C) 1999-2004 Plumber AT gnu-darwin.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Copyright (C) 1999-2004 Plumber http://plumber DOT  gnu-darwin DOT org
#
*/

Class postFile{

	function postFile(){
		
		for($i=0;$i<func_num_args();$i++){
			$arg[]=@func_get_arg($i);
		}
	
		$this->from=$arg[0];
		$this->to=$arg[1];
		
		$this->stream=$_FILES[$this->from];
	}
	
	function isUploaded(){
		if(is_uploaded_file($this->stream["tmp_name"])){
			return true;
		}
		return false;
	}
	
	function getMove(){
		move_uploaded_file($this->stream["tmp_name"],$this->to.$this- 
 >stream["name"]);
	}
	
	function getCHmod(){
	
		for($i=0;$i<func_num_args();$i++){
			$arg[]=@func_get_arg($i);
		}
	
		$this->newMod=$arg[0];
		
		chmod($this->to.($this->changeName ? $this->newName :  
$this->stream["name"]),$this->newMod);
	}
	
	function getBZ2(){
	
		$of=fopen($this->to.($this->changeName ? $this->newName :  
$this->stream["name"]),"r");
		$rf=fread($of,filesize($this->to.($this->changeName ? $this->newName  
: $this->stream["name"])));
		
		$bz=bzopen($this->to.($this->changeName ? $this->newName :  
$this->stream["name"]).".bz2","w");
		
		bzwrite($bz,$rf);
		bzclose($bz);
		
		unlink($this->to.($this->changeName ? $this->newName :  
$this->stream["name"]));
	}
	
	function getRename(){
	
		for($i=0;$i<func_num_args();$i++){
			$arg[]=@func_get_arg($i);
		}
	
		$this->newName=$arg[0];
		
		rename($this->to.$this->stream["name"],$this->to.$this->newName);
		
		$this->changeName=true;
	}
	
	function getSize(){
		return $this->stream["size"];
	}
	
	function getMimeType(){
		return $this->stream["type"];
	}
	
	function getTmpName(){
		return $this->stream["tmp_name"];
	}
	
	function getName(){
		return $this->stream["name"];
	}
	
	function getError(){
		return $this->stream["error"];
	}
	
}

?>



PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
     php-objects-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux