models / uploads_model.php
UploadsModel
Model
Manages media uploads to the server, checking for validity and returning relevant file info. Also manages thumbnails for both media and playlists.
public
file_info
(
id, key
)
public
file_info
(
id, key
)
Get relevant info about file upload.
Parameters
id |
Upload ID. |
key |
Upload key. |
Returns
[type, format, duration]
public
is_valid
(
id, key
)
public
is_valid
(
id, key
)
Return whether an uploaded file ID and associated key is valid. Returns FALSE if no ID or key is provided, or if no associated row can be found in the uploads database.
Returns
is_valid
public
thumbnail_get
(
id, type
)
public
thumbnail_get
(
id, type
)
Retrieve a thumbnail for media or a playlist.
Parameters
id |
Media or playlist ID. |
type |
Which thumbnail subdirectory to retrieve from (see thumbnail_save). |
Returns
[success, thumbnail_base64, msg]
public
thumbnail_save
(
id, type, data
)
public
thumbnail_save
(
id, type, data
)
Upload a thumbnail for media or a playlist.
Parameters
id |
Media or playlist ID. |
type |
Which thumbnail subdirectory to put things in (media or playlists, to make sure IDs don't overwrite each other). |
data |
Thumbnail data in base64 format as provided by JS FileReader. |
Returns
[success, msg]