aboutsummaryrefslogtreecommitdiff
path: root/h-source/Library/Files/Upload.php
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Library/Files/Upload.php')
-rwxr-xr-xh-source/Library/Files/Upload.php19
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);