Giter Site home page Giter Site logo

Comments (7)

pvolyntsev avatar pvolyntsev commented on June 3, 2024

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.

from yii2-cropper.

kh-mirzaev avatar kh-mirzaev commented on June 3, 2024

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?

from yii2-cropper.

vacoo avatar vacoo commented on June 3, 2024

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

from yii2-cropper.

aoonuos2013 avatar aoonuos2013 commented on June 3, 2024

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

from yii2-cropper.

mayankpal100 avatar mayankpal100 commented on June 3, 2024

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

from yii2-cropper.

mayankpal100 avatar mayankpal100 commented on June 3, 2024

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

from yii2-cropper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.