Show:

Q_File Class

Module: Q

Q File class

Item Index

Methods

Events

Methods

save

(
  • $params
)
Array static

Saves a file, usually sent by the client

Parameters:

  • $params Array
    • [data] String optional

      the file data

    • [path="Q/uploads"] String optional

      parent path under web dir (see subpath)

    • [subpath=""] String optional

      subpath that should follow the path, to save the image under

    • [name] String optional

      override the name of the file, after the subpath

    • [skipAccess=false] String optional

      if true, skips the check for authorization to write files there

    • [audio] Boolean optional

      set 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 String

    the user

  • path String

    the path in the url

  • subpath String

    the subpath in the url

  • name String

    the actual name of the file

  • writePath String

    the actual folder where the path is written

  • data String

    the data written to the file

  • tailUrl String

    consists of $path/[$subpath/]$name

  • size Integer

    the size of the file that was written

  • skipAccess Boolean

    whether we are skipping access checks

  • audio Boolean

    whether the file is audio