yii2-cropper icon indicating copy to clipboard operation
yii2-cropper copied to clipboard

404 when cropping image

Open kh-mirzaev opened this issue 9 years ago • 1 comments

I have same problem. When I upload image, and submit button Crop photo, after in console of browser appears such a alert " http://localhost/st2/frontend/web/uploads/post/ Failed to load resource: the server responded with a status of 404 (Not Found) "

 <?= $form->field($model, 'image')->widget(Widget::className(), [
    'uploadUrl' => Url::toRoute('uploads/post/'),
]) ?>

.

}
public function actions()
{
    return [
        'uploadPhoto' => [
            'class' => 'budyaga\cropper\actions\UploadAction',
            'url' =>  Yii::$app->request->baseUrl.'/uploads/post/thumb',
            'path' => Yii::$app->request->baseUrl.'/uploads/post/thumb',
        ]
    ];
}

How can I fix it?

kh-mirzaev avatar Jul 04 '16 06:07 kh-mirzaev

SiteController

 public function actionError()
    {
        $this->layout = 'content';
        $exception    = Yii::$app->errorHandler->exception;
        echo '<pre>';
        var_dump($exception);
        echo '</pre>';
    }

if you have custom error page

kv4nt avatar Aug 16 '16 12:08 kv4nt