Q_File Class
Q File class
Methods
save
(
Array
static
-
$params
Saves a file, usually sent by the client
Parameters:
-
$paramsArray-
[data]String optionalthe file data
-
[path="Q/uploads"]String optionalparent path under web dir (see subpath)
-
[subpath=""]String optionalsubpath that should follow the path, to save the image under
-
[name]String optionaloverride the name of the file, after the subpath
-
[skipAccess=false]String optionalif true, skips the check for authorization to write files there
-
[audio]Boolean optionalset this to true if the file is an audio file
-
Returns:
Array:
Returns array containing ($name => $tailUrl) pair
Events
Q/file/save
After
Event Payload:
-
userStringthe user
-
pathStringthe path in the url
-
subpathStringthe subpath in the url
-
nameStringthe actual name of the file
-
writePathStringthe actual folder where the path is written
-
dataStringthe data written to the file
-
tailUrlStringconsists of $path/[$subpath/]$name
-
sizeIntegerthe size of the file that was written
-
skipAccessBooleanwhether we are skipping access checks
-
audioBooleanwhether the file is audio