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 ¶
- if you will generate image thumbnail, you must set attribute fileType to 'image' and set generateThumbnail to true.
 - Generate picture thumbnail use EasyPHPThumb extension, you must download and setting it.
 - picture thumbnail width and heigth settings is saved in database now.
 - 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...
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.