Skip to content

Commit 4f1cd6c

Browse files
committed
Update README
1 parent 39c87e8 commit 4f1cd6c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)