File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -373,14 +373,16 @@ Override the `attributePaths()` method to change the base path where the files w
373373``` php
374374$image = \yii\web\UploadedFile::getInstance($model, 'image');
375375
376- // Save image as image_thumb.png on S3 at //my_bucket/images/ path
377- // $model->image will hold "image_thumb.png" after this call finish with success
378- $model->saveUploadedFile($image, 'image', 'image_thumb.png');
379-
380376// Save image_thumb.* to S3 on //my_bucket/images/ path
381377// The extension of the file will be determined by the submitted file type
382378// This allows multiple file types upload (png,jpg,gif,...)
383- $model->saveUploadedFile($image, 'image', 'image_thumb', true);
379+ // $model->image will hold "image_thumb.png" after this call finish with success
380+ $model->saveUploadedFile($image, 'image', 'image_thumb');
381+
382+ // Save image_thumb.png to S3 on //my_bucket/images/ path
383+ // The extension of the file will be determined by the submitted file type
384+ // This force the extension to *.png
385+ $model->saveUploadedFile($image, 'image', 'image_thumb.png', false);
384386
385387// Get the URL to the image on S3
386388$model->getFileUrl('image');
You can’t perform that action at this time.
0 commit comments