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, | |
| FileUpload::setContents | ( | $ | file | ) |
set all contents about the file
example: $upload->getContents( $_FILES["file"] );
| file | $_FILES["file"] |
| 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.') |
<
| FileUpload::getContents | ( | ) |
get data about uploaded file
| FileUpload::setRandomAddSize | ( | $ | int | ) |
sets $this->random_size
| int | (1-32) number of random chars of false |
| FileUpload::setPath | ( | $ | path | ) |
sets the $this->dir
| path | to upload dir |
| FileUpload::setMaxNameSize | ( | $ | max_name_size | ) |
sets $this->max_name_size
| max_name_size | int bigger than 5 |
| FileUpload::setNameFormating | ( | $ | format | ) |
sets $this->name_formating
| format | bool |
| FileUpload::setRandomEnding | ( | $ | format | ) |
sets $this->random_end
| format | bool |
| FileUpload::setMd5Making | ( | $ | make | ) |
sets $this->make_md5
| make | bool |
| FileUpload::uploadFile | ( | $ | move = false |
) |
uploads file,
formats the file name, generates new random names, makes md5 sum all according to configuration
| move | if true uses move_uploaded_file() else copy() |
| Exception | new Exception('File ('.$this->file["full_name"].') you are trying to upload exists on serwer') |
1.5.6