It returns 500 Internal Server Error when I try to add an image. The error is : Call to a member function addImage() on null
in C:\OpenServer\domains\azreal.az\vendor\zxbodya\yii2-gallery-manager\GalleryManagerAction.php at line 111
102103104105106107108109110111112113114115116117118119120 *
@return string
@throws HttpException
*/
public function actionAjaxUpload()
{
It returns 500 Internal Server Error when I try to add an image. The error is : Call to a member function addImage() on null
in C:\OpenServer\domains\azreal.az\vendor\zxbodya\yii2-gallery-manager\GalleryManagerAction.php at line 111 102103104105106107108109110111112113114115116117118119120 *
@throws HttpException */ public function actionAjaxUpload() {
$imageFile = UploadedFile::getInstanceByName('image'); $fileName = $imageFile->tempName; $image = $this->behavior->addImage($fileName);
// not "application/json", because IE8 trying to save response as a file
Yii::$app->response->headers->set('Content-Type', 'text/html');
return Json::encode( array( 'id' => $image->id, 'rank' => $image->rank,