I want to implement a file upload in my Yii2 application. This should be possible via Web and Console command.
Is there a helper in Yii2, so I can use the same implementation? (I started with yii\web\UploadFile for the web frontend and realized that I can't use that for the console command)
The yii\web\UploadFile class is designed to work with ActiveForm, or more specifically with the $_FILES content.
UploadedFilework with$_FILESarray, which get data from HTTP POST. So, you cannot useUploadedFiledirectly to work with CLI. As variant, you can try to usecurlRelated question.