Filesystem data folder

If you need to store data in the filesystem, specify the protected $data_directories attribute in your class, for instance:

    protected $data_directories = array(
      'image_original' => '/media/slideshow/original',
      'image_thumbs' => '/media/slideshow/thumbs',
      'image_large' => '/media/slideshow/xl' 
    );
    

These directories will be created upon first time to save an object.

To retrieve the data, you can use $this->getDataFileFullPath('image_large','filename.jpg'). If you need to get the full URL path, you can use $this->getDataFileURLPath('image_large','filename.jpg').

In the above example, the data directory starts with /media. If you need to store data that cannot be read by the web browser, use /data/private/ instead. For example:

    protected $data_directories = array(
      'downloads' => '/data/private/downloads',
      'icons' => '/media/download-icons'
    );