Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi i'm getting a 404 when i try to cropp de image #3

Open
brizacho opened this issue Mar 10, 2016 · 7 comments
Open

Hi i'm getting a 404 when i try to cropp de image #3

brizacho opened this issue Mar 10, 2016 · 7 comments

Comments

@brizacho
Copy link

No description provided.

@brizacho brizacho reopened this Apr 5, 2016
@pvolyntsev
Copy link

pvolyntsev commented Jun 20, 2016

I also got "404 Page not found"

Tried to debug and found that Widget::$uploadUrl is appended with "/" and become "/user/user/uploadPhoto/"
The enabled option "enableStrictParsing" in my "urlManager" configuration lead to Yii can't parse "/user/user/uploadPhoto/" with extra slash at the end.

To fix it I added url rule with '?' like that

      'urlManager' => [
            'showScriptName' => false,     // Disable index.php
            'enablePrettyUrl' => true,     // Disable ?r= routes
            'enableStrictParsing' => true, // Only routes being listed in rules
            'rules' => [
                '/uploadUserPhoto?' => '/user/user/uploadPhoto',


And "404 Page not found" issue is solved for me.

@kh-mirzaev
Copy link

kh-mirzaev commented Jul 4, 2016

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?

@vacoo
Copy link

vacoo commented Nov 14, 2017

Я решил проблему так:
В видах указал контроллер загрузки изображений: 'uploadUrl' => '/adminpanel/products/uploadPhoto',
А в контроллере в качестве пути сделал: 'path' => $_SERVER['DOCUMENT_ROOT'].'/uploads',
https://pastebin.com/jtAXXMaD

@aoonuos2013
Copy link

Hi i'm getting a 404 when i try to click in crop image.please help me to resolve this issue

@mayankpal100
Copy link

just make a page in the controller and receive all information about the image and do all your entries in data base and return 1

@mayankpal100
Copy link

use this [https://github.com/rezaei121/yii2-jcrop] ( it works very good)

@mehdi-hashemi-01
Copy link

mehdi-hashemi-01 commented Dec 1, 2023

`` <?= $form->field($model, 'image')->widget(Widget::className(), [

'uploadUrl' =>Yii::$app->urlManager->createUrl('uploads'),

]) ?>``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants