PHP Classes
Icontem

File: uploaded_file.class.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Sven Wagener  >  File class  >  uploaded_file.class.php  
File: uploaded_file.class.php
Role: Class source
Content type: text/plain
Description: Extends file class with special uploaded file functions
Class: File class
File manipulation and form upload handling
 

Contents

Class file image Download
<?
/**
* Uploaded file handling class
*
* @author    Sven Wagener <wagener_at_indot_dot_de>
* @include      Funktion:_include_
*/
include("file.class.php");

class 
uploaded_file extends file{
    var 
$upload_name;
    var 
$upload_tmp_name;
    var 
$upload_size;
    var 
$upload_type;
    
    
/**
    * Constructor of class
    * @param array $file_form_array $_FILE Array of uploaded file
    * @return boolean $file_exists Returns TRUE if file is ok, FALSE if file is faked
    * @desc Constructor of class
    */
    
function uploaded_file($form_file_array,$binary=false){
        if(
$form_file_array['size']!=0){
            
$this->file=$file_form_array;
            
$this->upload_name=$form_file_array['name'];
            
$this->upload_tmp_name=$form_file_array['tmp_name'];
            
$this->upload_size=$form_file_array['size'];
            
$this->upload_type=$form_file_array['type'];
            
$this->file($form_file_array['tmp_name'],$binary);
        }else{
            
$this->halt("File size must be more than 0 bytes");
            return 
false;
        }
    }
    
    
/**
    * Returns real filename
    * @return string $file_name The real filename
    * @desc Returns real filename
    */
    
function get_upload_name(){
        return 
$this->upload_name;
    }
    
    
/**
    * Returns temporary name of file, given by the form
    * @return string $file_tmp_name The temporary filename, given by the form
    * @desc Returns temporary name of file, given by the form
    */
    
function get_upload_tmp_name(){
        return 
$this->upload_tmp_name;
    }
    
    
/**
    * Returns file size, given by the form
    * @return int $file_size The file size, given by the form in bytes
    * @desc Returns the file size, given by the form
    */
    
function get_upload_size(){
        return 
$this->upload_size;
    }
    
    
/**
    * Returns file type, given by the form
    * @return string $file_type The file type, given by the form
    * @desc Returns file type, given by the form
    */
    
function get_upload_type(){
        return 
$this->upload_type;
    }
}

?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products