13/05
2014
dev-master
9999999-devZF2 File Storage Module
MIT
The Requires
- php >=5.4
- ext-imagick *
zf2 module
Wallogit.com
2017 © Pedro PelĂĄez
ZF2 File Storage Module
This module helps you to store and retrieve files based on namespaces/id, (*1)
In the module.config.php:, (*2)
<?php
namespace Application;
return array(
//...
'filestorage' => array(
'namespaces' => array(
'my_nice_namespace' => array(
'driver' => 'filesystem',
'options' => array(
'directory' => getcwd() . '/data/images',
'subdivide' => true,
'files_per_folder' => 1000
)
)
)
),
//....
);
Usage in the controller:, (*3)
<?php
namespace Application\Controller;
//...
class SomeController
{
//...
public function someAction()
{
//... receive post data and insert into the database
$this->getServiceLocator()->get('filestorage')
->setNamespace('my_nice_namespace')
->addBase64Image($id, $base64Data)
->save();
//...
}
}
ZF2 File Storage Module
MIT
zf2 module