storage_path¶
Usage¶
Changes the path to where a file is stored. This can be a simpler solution than writing your own storage adapter class.
Examples¶
Store files in different directories by extension.
class MyPlugin extends :php:class:`Omeka_Plugin_AbstractPlugin`
{
protected $_filters = array('storage_path');
public filterStoragePath($path, $args)
{
$explodedFileName = explode('.', $args['filename']);
$extension = $explodedFileName[count($explodedFileName)-1];
return 'files/' . $extension . '/' . $args['filename'];
}
}