Summary
- File
- Package hierarchy IO
- Class hierarchy \Upload
This class provides you methods to upload easily files to the ftp.
This class provides you methods to upload easily files to the ftp.
__construct(string $base_directory = 'upload')
constructor
string | $base_directory | Set the directory to upload the files. |
None found |
file(string $filepostname, string $regexp = '', boolean $uniq_name = false, integer $weight_max = 100000000, boolean $check_exist = true) : boolean
Uploads a file.
string | $filepostname | Name in the input file formulary. |
string | $regexp | Regular expression to specify file format. |
boolean | $uniq_name | If true assign a new name if a file with same name already exist. Otherwise previous file is overwrite. |
integer | $weight_max | The maximum file size. |
boolean | $check_exist | If true verify if a file with the same name exist on the ftp. Otherwise previous file is overwrite. |
True if the file has been succefully uploaded. Error code if an error occured.
None found |
check_img(integer $width_max, integer $height_max, boolean $delete = true) : string
Checks whether an image is compliant to an maximum width and height, otherwise is $delete value is true delete it.
integer | $width_max | Max width |
integer | $height_max | Max height |
boolean | $delete |
Error code.
None found |
get_human_readable_size(integer $round = 1) : float
Returns filesize in human readable representation.
integer | $round | The number of decimal points |
filesize
None found |
disableContentCheck()
None found |
get_error()
None found |
get_extension()
None found |
get_original_filename()
None found |
get_filename()
None found |
get_size()
None found |
get_files_parameters()
None found |
check_file_content( $file)
Check the file content for php tags to avoid illegal uploads
$file |
None found |
check_file_path(string $regexp) : boolean
Checks the validity of a file with regular expression.
string | $regexp | Regular expression |
The result of the regular expression test.
None found |
generate_file_info(boolean $uniq_name)
Generates a unique file name. Completes informations on the file.
boolean | $uniq_name |
None found |
clean_filename( $string) : string
Clean the url, replace special characters with underscore.
$string |
The cleaned file name.
None found |
error_manager(string $error) : string
Manages error code during upload.
string | $error |
Error code.
None found |
$error :
None found |
$base_directory :
None found |
$extension :
None found |
$filename :
None found |
$original_filename :
None found |
$size :
None found |
$contentCheck :
None found |
$isMultiple :
None found |
$files_parameters :
None found |