Comments (7)
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.
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.
Я решил проблему так:
В видах указал контроллер загрузки изображений: 'uploadUrl' => '/adminpanel/products/uploadPhoto',
А в контроллере в качестве пути сделал: 'path' => $_SERVER['DOCUMENT_ROOT'].'/uploads',
https://pastebin.com/jtAXXMaD
from yii2-cropper.
Hi i'm getting a 404 when i try to click in crop image.please help me to resolve this issue
from yii2-cropper.
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.
use this [https://github.com/rezaei121/yii2-jcrop] ( it works very good)
from yii2-cropper.
Related Issues (20)
- Hide/show new-photo-area
- Не правильно работает с большими изображениями
- UploadAction, invalid uploadParameter
- Edit existing image
- Passing path to crop to model HOT 1
- It doesn't delete file when clicking Delete photo HOT 1
- Filename HOT 2
- How to get the final filename?
- How to save full uploaded image?
- What the that line condition separated with comma? HOT 1
- неправильная работа js
- Need an option to save original image HOT 3
- Delete Image should delete the file
- Regarding Storing file to S3
- UploadUrl parameter
- Erron on crop HOT 1
- Drag and drop not working
- 404 when cropping image HOT 1
- Apache crashes when cropping image HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-cropper.