uploaderbehavior a file upload behavior

  1. Requirements
  2. Usage
  3. Notice
  4. Resources

a file upload behavior

Requirements

...requirements of using this extension (testing 1.1.4)...

Usage

...copy it to you components directory or other directory, import it...

...can use code blocks like the following...

public function behaviors() {
        return array(            
            'UploaderBehavior' => array(
                'class' => 'ext.behaviors.UploaderBehavior',
                'uploadSavedPathAttributes' => array(
                    'picture_saved_path' => array(
                        'fileType' => 'image',
                        'fileName' => 'attribute name, if fileName attribute is not in required rule and you don not input it, fileName attribute will set it to you upload filename',
                        'fileSize' => 'file size attribute name',
                        'fileExt' => 'file extension attribute name',
                        'generateThumbnail' => true,
                    ),
                ),
            ),
        );
    }

Notice

  1. if you will generate image thumbnail, you must set attribute fileType to 'image' and set generateThumbnail to true.
  2. Generate picture thumbnail use EasyPHPThumb extension, you must download and setting it.
  3. picture thumbnail width and heigth settings is saved in database now.
  4. Thumbnail saved path don't saved in database, if a picture filename is a.jpg, thumbnail filename will is a_thumb.jpg

    Resources

...external resources for this extension...

2 3
3 followers
1 444 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: File System
Tags: upload
Developed by: hiscaler
Created on: Nov 6, 2010
Last updated: 14 years ago

Downloads

show all

Related Extensions