diff options
| author | Antonio Gallo <tonicucoz@gmail.com> | 2011-07-28 20:27:23 +0000 | 
|---|---|---|
| committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-07-28 20:27:23 +0000 | 
| commit | e7b3717614621f14695ab6ca6dda6dd17ba3d65c (patch) | |
| tree | c8e6061aef3ff7bad5a17e1aecaf441d35e282cb /h-source/Library/Files | |
| parent | 0de74c6879d263645770de3d6b3ce7123f5241d6 (diff) | |
added new easygiant library
Diffstat (limited to 'h-source/Library/Files')
| -rwxr-xr-x | h-source/Library/Files/Upload.php | 19 | 
1 files changed, 14 insertions, 5 deletions
diff --git a/h-source/Library/Files/Upload.php b/h-source/Library/Files/Upload.php index 0c459ff..53d88f2 100755 --- a/h-source/Library/Files/Upload.php +++ b/h-source/Library/Files/Upload.php @@ -56,7 +56,7 @@ class Files_Upload  			'createFolderAction'			=>	'createFolderAction',  			'uploadFileAction'				=>	'uploadFileAction',  			'maxFileSize' 					=>	3000000, -			'language' 						=>	'Eng', +			'language' 						=>	'En',  			'allowedExtensions'				=>	'jpg,jpeg,png,gif,txt',  			'fileUploadKey' 				=>	'userfile',  			'fileUploadBehaviour'			=>	'add_token', //can be none or add_token @@ -78,7 +78,7 @@ class Files_Upload  		$stringClass = 'Lang_'.$this->params['language'].'_UploadStrings';  		if (!class_exists($stringClass))  		{ -			$stringClass = 'Lang_Eng_UploadStrings'; +			$stringClass = 'Lang_En_UploadStrings';  		}  		$this->_resultString = new $stringClass(); @@ -157,6 +157,15 @@ class Files_Upload  		return $this->base;  	} +	public function setBase($path) +	{ +		$this->base = $this->addTrailingSlash($path); + +		//set the match pattern +		$tmp = str_replace(self::DS,'\\'.self::DS,$this->base); +		$this->pattern = "/^(".$tmp.")/"; +	} +  	public function getSubDir() {  		return $this->subDir;  	} @@ -213,13 +222,13 @@ class Files_Upload  	}  	//get the extension of the file -	protected function getFileExtension($file) +	public function getFileExtension($file)  	{  		return strtolower(end(explode('.', $file)));  	}  	//get the file name without the extension -	protected function getNameWithoutFileExtension($file) +	public function getNameWithoutFileExtension($file)  	{  		$copy = explode('.', $file);  		array_pop($copy); @@ -227,7 +236,7 @@ class Files_Upload  	}  	//get a not existing file name if the one retrieved from the upload process already exists in the current directory -	protected function getUniqueName($file,$int = 0) +	public function getUniqueName($file,$int = 0)  	{  		$fileNameWithoutExt = $this->getNameWithoutFileExtension($file);  		$extension = $this->getFileExtension($file);  | 
