kartik-v / yii2-widget-fileinput

An enhanced FileInput widget for Bootstrap 4.x/3.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)
Other
229 stars 96 forks source link

When 'multiple' => true and set uploadUrl, then UploadedFile return empty result. #155

Closed 4khobta closed 4 years ago

4khobta commented 5 years ago
                <?=
                FileInput::widget([
                    'model' => $file_model,
                    'attribute' => 'file',
                    'resizeImages' => true,
                    'options' => ['id' => 'comments-files',
                    'multiple' => true
                    ],
                    'pluginOptions' => [
                        'showPreview' => false,
                        'uploadUrl' => Url::to(['/file/upload']),
                        'maxFileCount' => 10
                    ],
                ]);
                ?>

When 'multiple' => true and set uploadUrl, then UploadedFile return empty result. After update fix 147 "Auto-set multiple file upload naming convention"

Maybe fix problem in FileInput.php:

107 - if (ArrayHelper::getValue($this->options, 'multiple')) {
107 + if (ArrayHelper::getValue($this->options, 'multiple') && !ArrayHelper::getValue($this->pluginOptions, 'uploadUrl')) {
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Datastore24Kirill commented 5 years ago
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.