Login   Register  
PHP Classes
elePHPant
Icontem

File: baseClass/uploadEngineClass.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jonathan Alexey  >  UploadFile  >  baseClass/uploadEngineClass.php  >  Download  
File: baseClass/uploadEngineClass.php
Role: Class source
Content type: text/plain
Description: Main Class
Class: UploadFile
Process uploaded image files
Author: By
Last change:
Date: 2010-01-19 13:09
Size: 1,156 bytes
 

Contents

Class file image Download
<?php
class uploadFile {
    
    
/*#
    #
    # Mother Class
    #
    # Version: 0.5
    #
    #
    */#

    
var $fileName;
    var 
$fileTmpName;
    var 
$fileSize;
    var 
$fileType;
    var 
$fileErro;
    var 
$fileDestinationTmp;
    var 
$fileDestination;
    
    function 
uploadFile ($name,$tmpName,$size,$type,$erro="0") {
        
$this->fileName=$name;
        
$this->fileTmpName=$tmpName;
        
$this->fileSize=round($size/1024);
        
$this->fileType=$type;
        
$this->fileErro=$erro;
    }
    
    function 
setDestinationFile ($TmpDir,$Dir) {
        
$this->fileDestinationTmp=$TmpDir;
       
$this->fileDestination=$Dir;
    }
    
    function 
moveFile () {
        if(
move_uploaded_file($this->fileTmpName,$this->fileDestinationTmp.$this->fileName)) {
            return 
true;
        }else{
            return 
false;
        }
    }
    
    function 
copyFile($dirTmpFile,$dirFile) {
        if(
copy($dirTmpFile.$this->fileName,$dirFile.$this->fileName)) {
            return 
true;    
        }else{
            return 
false;
        }
    }
    
    function 
fileUnlink ($file) {
        if(
unlink($file)) {
            return 
true;
        }else{
            return 
false;
        }
    }
}
?>