namespace \webfiori\framework
class Uploader
Class Attributes Summary
Class Methods Summary
Class Attributes Details
Class Methods Details
Parameters:
Returns a JSON string that represents the object. The string will be something the the following:
{   "upload-directory":"",   "allowed-types":[],   "files":[],   "associated-file-name":"" }
Parameters:
- string $ext File extension (e.g. jpg, png, pdf).
Parameters:
- array $arr An array of strings. Each string represents a file type.
Returns an array which contains all information about the uploaded files. The returned array will be indexed. At each index, a sub associative array that holds uploaded file information. Each array will have the following indices:
- name: The name of the uploaded file.
- size: The size of the uploaded file in bytes.
- upload-path: The location at which the file was uploaded to in the server.
- upload-error: Any error which has happend during upload.
- is-exist: A boolean. Set to true if the file does exist in the server.
- is-replace: A boolean. Set to true if the file was already uploaded and replaced.
- mime: MIME type of the file.
- uploaded: A boolean. Set to true if the file was uploaded.
Parameters:
- boolean $asObj If this parameter is set to true, the returned array will contain objects of type 'UploadedFile' instead of sub associative arrays. Default value is true.
Parameters:
- string $ext File extension= (e.g. jpg, png, pdf,...).
Parameters:
- string $name The name of the index at which the file is stored in the array $_FILES. input element.
Parameters:
- string $dir Upload Directory (such as '/files/uploads' or 'C:/Server/uploads').
Parameters:
- bolean $replaceIfExist If a file with the given name found and this parameter is set to true, the file will be replaced.
- name: The name of uploaded file.
- size: The size of uploaded file in bytes.
- upload-path: The location at which the file was uploaded to in the server.
- upload-error: A string that represents upload error.
- is-exist: A boolean. Set to true if the file was found in the server.
- is-replace: A boolean. Set to true if the file was exist and replaced.
- mime: MIME type of the file.
- uploaded: A boolean. Set to true if the file was uploaded.
Parameters:
- bolean $replaceIfExist If a file with the given name found and this parameter is set to true, the file will be replaced.