media

From SkyPHP

Jump to: navigation, search

The media class is used to manage user-uploaded files.

Contents

PHP Functions

Media Items

Any type of file can be uploaded. Every media item must be saved to a vfolder.

Vfolders

Vfolders can be identified by either a) the media_vfolder_id, or b) the vfolder_path. The vfolder path must always begin with a forward slash "/".

Often, you need to create media folders for records in the database. You should name your vfolder the same as your table name.

$vfolder_path = "/person/{$person_id}"; 
# example:  /person/123

Resizing, Cropping, and Image Quality

media::get_item() and other functions (see above) allow you to specify the image dimensions and image quality. This way you can upload hi-res images, and create thumbnails automatically.

Known Bugs & Issues

  • get_item() does not display flash in a skybox
  • separate original uploaded files from resizes - allows rsync of originals only
  • top level folder should be used to segment different websites/accounts
  • media_distro should be for reference, but other servers may have the file
  • get_item - option to use full domain instead of relative url
  • global image skybox
  • CDN mode for a media_host
Personal tools