FileUpload Class Reference

List of all members.

Public Member Functions

 __construct ()
 sets randomize seed
 setContents ($file)
 set all contents about the file
 getContents ()
 get data about uploaded file
 setRandomAddSize ($int)
 sets $this->random_size
 setPath ($path)
 sets the $this->dir
 setMaxNameSize ($max_name_size)
 sets $this->max_name_size
 setNameFormating ($format)
 sets $this->name_formating
 setRandomEnding ($format)
 sets $this->random_end
 setMd5Making ($make)
 sets $this->make_md5
 uploadFile ($move=false)
 uploads file,


Detailed Description

allow easy upload with php and web forms
Author:
Szymon Ɓukaszczyk <szymon.lukaszczyk@gmail.com>
Since:
April/2007

Member Function Documentation

FileUpload::setContents ( file  ) 

set all contents about the file

example: $upload->getContents( $_FILES["file"] );

Parameters:
file $_FILES["file"]
Exceptions:
Exception new Exception('The file was not uploaded to /tmp directory')
Exception new Exception('The uploaded file exceeds the upload_max_filesize '.ini_get("upload_max_filesize").' directive in php.ini.')
Exception new Exception('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.')
Exception new Exception('The uploaded file was only partially uploaded.')
Exception new Exception('No file was uploaded.')
Exception new Exception('Missing a temporary folder.')
Exception new Exception('Failed to write file to disk.')
Exception new Exception('File upload stopped by extension.')
Returns:
false if $file is not valid

<

FileUpload::getContents (  ) 

get data about uploaded file

Returns:

FileUpload::setRandomAddSize ( int  ) 

sets $this->random_size

Parameters:
int (1-32) number of random chars of false

FileUpload::setPath ( path  ) 

sets the $this->dir

Parameters:
path to upload dir

FileUpload::setMaxNameSize ( max_name_size  ) 

sets $this->max_name_size

Parameters:
max_name_size int bigger than 5

FileUpload::setNameFormating ( format  ) 

sets $this->name_formating

Parameters:
format bool

FileUpload::setRandomEnding ( format  ) 

sets $this->random_end

Parameters:
format bool

FileUpload::setMd5Making ( make  ) 

sets $this->make_md5

Parameters:
make bool

FileUpload::uploadFile ( move = false  ) 

uploads file,

formats the file name, generates new random names, makes md5 sum all according to configuration

Parameters:
move if true uses move_uploaded_file() else copy()
Exceptions:
Exception new Exception('File ('.$this->file["full_name"].') you are trying to upload exists on serwer')
Returns:
(bool) true if succes else false


The documentation for this class was generated from the following file:

Generated on Wed Jul 9 19:46:53 2008 for FileUpload by  doxygen 1.5.6