yii-dream-team / yii2-upload-behavior

Yii2 file/image upload behavior for ActiveRecord
http://yiidreamteam.com/yii2/upload-behavior
MIT License
77 stars 45 forks source link

Multi attributes : delete one image of the two images on save #5

Closed timmy78 closed 8 years ago

timmy78 commented 9 years ago

I, it's again me ! :tada:

Here my code :

public function behaviors()
{
    return [
        [
            'class' => '\yiidreamteam\upload\ImageUploadBehavior',
            'attribute' => 'logo',
            'filePath' => '@webroot/images/application/[[pk]]/android_[[basename]]',
            'fileUrl' => '@web/images/application/[[pk]]/android_[[basename]]',
        ],
        [
            'class' => '\yiidreamteam\upload\ImageUploadBehavior',
            'attribute' => 'feature_graphic',
            'filePath' => '@webroot/images/application/[[pk]]/feature_graphic_[[basename]]',
            'fileUrl' => '@web/images/application/[[pk]]/feature_graphic_[[basename]]',
        ],
    ];
}

I have two image attributes in the same form : logo & feature-graphic

I don't know if you need mor details or precisions ?

Thanks !

johnb0 commented 9 years ago

I have the same problem. Someone found a solution? Thanks

floriandootz commented 9 years ago

Same issue here. Is there a workaround yet?