2017 © Pedro Peláez
 

library zf3fileupload

Custom file upload element for zf3, supports filesystem and database storage(using DoctrineORM)

image

bishwopl/zf3fileupload

Custom file upload element for zf3, supports filesystem and database storage(using DoctrineORM)

  • Monday, June 11, 2018
  • by bishwopl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 98 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 19 Versions
  • 10 % Grown

The README.md

(Not ready for production), (*1)

zf3fileupload

Custom file upload element for zf3, supports filesystem and database storage(using DoctrineORM), (*2)

Requirements

Sample Element

    public function init()
    {
        $this->add([
            'type' => 'fileupload',
            'name' => 'start_date',
            'attributes' => [
                'formUniqueId'      => 'photo_',
                'id'                => 'photoPathId',
                'storage'           => 'db', // 'filesystem' or 'db
                'showProgress'      => TRUE,
                'multiple'          => TRUE,
                'enableRemove'      => TRUE,
                'uploadDir'         => 'data/UserData/',
                'icon'              => 'fa fa-upload',
                'successIcon'       => 'fa fa-pencil',
                'errorIcon'         => 'fa fa-remove',
                'class'             => 'btn btn-default',
                'uploadText'        => 'Upload Photo',
                'successText'       => 'Change Photo',
                'errorText'         => 'Try Again',
                'uploadingText'     => 'Uploading Photo...',
                'replacePrevious'   => TRUE,
                'randomizeName'     => TRUE,
                'showPreview'       => TRUE,
                'validator' => [ 
                    'allowedExtentions' => 'jpg,png',
                    'allowedMime'       => 'image/jpeg,image/png',
                    'minSize'           => 10,
                    'maxSize'           => 500*1024,
                    'image' => [
                        'minWidth'  => 0,
                        'minHeight' => 0,
                        'maxWidth'  => 1200,
                        'maxHeight' => 1000,
                    ],
                ],
                'crop' => [
                    'width'  => 200,
                    'height' => 200,
                ],
                'preview'=>[
                    'width'  => 100,
                    'height' => 100,
                ],
                'callback'=>[
                    //first callback must be as follows others can be configured as user desires
                    //[
                    //    'object'    => 'object',
                    //    'function'  => 'name of function to call',
                    //    'parameter' => 'name(s) with full path of file(s) uploaded eparated with comma '
                    //]
                ]
            ],
            'options' => [
                'label' => 'Abc',
            ],
        ]);
    }

The Versions

04/04 2018