2017 © Pedro PelĂĄez
 

library caf-file-storage

ZF2 File Storage Module

image

caferrari/caf-file-storage

ZF2 File Storage Module

  • Tuesday, May 13, 2014
  • by caferrari
  • Repository
  • 1 Watchers
  • 2 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ZF2 File Storage Module

This module helps you to store and retrieve files based on namespaces/id, (*1)

Saving Base64 encoded images

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();

        //...
    }

}

The Versions

13/05 2014

dev-master

9999999-dev

ZF2 File Storage Module

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-imagick *

 

zf2 module