26 private $sOriginFileName;
27 private $sTmpFileName;
31 private $salt=
'1EE7a89';
39 if(isset($_FILES[$sColumn]) && $_FILES[$sColumn][
'size'] > 0){
41 $this->tFile=$_FILES[$sColumn];
42 $this->sOriginFileName=basename($_FILES[$sColumn][
'name']);
43 $this->sTmpFileName=$_FILES[$sColumn][
'tmp_name'];
44 $this->loadExtension();
56 public function saveAs($sNewFileName){
57 $this->sNewPath=$sNewFileName.sha1($this->salt.$sNewFileName).
'.'.time().
'.'.$this->sExtension;
59 if(move_uploaded_file($this->sTmpFileName, $this->sNewPath)){
72 return $this->sNewPath;
83 private function loadExtension(){
84 $tFileName=preg_split(
'/\./',$this->sOriginFileName);
85 $this->sExtension= end($tFileName);