Open nlrooat opened 8 years ago
@nlrooat I think this has nothing to do with the extension. The problem is that you try to set the attributes of your UploadFile Model using the 'post'ed variables, and the correct way is that you do only this IF no other attributes are set on the form:
$model = new UploadFile;
$file = UploadedFile::getInstance($model, 'file');
if($file) {
.... whatever
Hi,
A couple of days ago I updated the yii2-file-upload-widget extension. Before that time, everything worked fine. Since the update, I get an error when updating files.
Widget:
Controller:
The
$post
variable above is an empty array, so that the if statement is never entered. When I use$post = $_FILES;
instead of$post = Yii::$app->request->post();
, everything works just fine. Why is the post request variable an empty array? What am I doing wrong here?Thanks!