Q_File Class
Q File class
Methods
save
(
Array
static
-
$params
Saves a file, usually sent by the client
Parameters:
-
$params
Array-
[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:
-
user
Stringthe user
-
path
Stringthe path in the url
-
subpath
Stringthe subpath in the url
-
name
Stringthe actual name of the file
-
writePath
Stringthe actual folder where the path is written
-
data
Stringthe data written to the file
-
tailUrl
Stringconsists of $path/[$subpath/]$name
-
size
Integerthe size of the file that was written
-
skipAccess
Booleanwhether we are skipping access checks
-
audio
Booleanwhether the file is audio