yii2-cropper
yii2-cropper copied to clipboard
404 when cropping image
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?
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