I am using old (outdated) jQuery image upload libraries fengyuanchen cropper.js and tuyoshivinicius jQuery-Picture-Cut. And have error with upload functionality. It not show file chosen from upload form.
Console log show 405 error.
It take me few days (not really focus on) but at first I guess the problem is within the JS library. Ton of jQuery plugin and JS script. Many outdated since 2015, like jQuery-Picture-Cut have removed.
Fengyuanchen cropper seem still work and document keep maintenanced.
https://github.com/fengyuanchen/cropper
One of my function use this library and it still work well.
So I firstly try to apply this function to my broken admin upload crop image function. Fortunately I jumped into nginx issue search and fixed it.
https://stackoverflow.com/questions/44612803/405-error-with-ajax-post-nginx-configuration
Nginx server doesn't allow POST request with static page (ie. *.html).
There are hacks to handle the problem. In my case, it fix the 405 error but the emails weren't send.
The solution was to change the index.html to index.php, be sure to adapt your Nginx configuration to reflect this changes.
This guy talking about developer life, cool but not about 405 bug kkk :)
https://distinctplace.com/2017/04/17/405-not-allowed-nginx-fix-post-requests/
My site is an old Yii 1 CMS app, so there are many outdated component. PHP only keep working when downgrade to 7.1. I am trying to rewrite it in modern app like reactjs, but anyway it's an good experiment on maintaining LAMP/LEMP stack with heavy JS (jQuery). And many cool functionality can be the checklist to find out good Angular or ReactJS CMS alternative.
Console log show 405 error.
It take me few days (not really focus on) but at first I guess the problem is within the JS library. Ton of jQuery plugin and JS script. Many outdated since 2015, like jQuery-Picture-Cut have removed.
Fengyuanchen cropper seem still work and document keep maintenanced.
https://github.com/fengyuanchen/cropper
One of my function use this library and it still work well.
So I firstly try to apply this function to my broken admin upload crop image function. Fortunately I jumped into nginx issue search and fixed it.
https://stackoverflow.com/questions/44612803/405-error-with-ajax-post-nginx-configuration
Nginx server doesn't allow POST request with static page (ie. *.html).
There are hacks to handle the problem. In my case, it fix the 405 error but the emails weren't send.
The solution was to change the index.html to index.php, be sure to adapt your Nginx configuration to reflect this changes.
This guy talking about developer life, cool but not about 405 bug kkk :)
https://distinctplace.com/2017/04/17/405-not-allowed-nginx-fix-post-requests/
My site is an old Yii 1 CMS app, so there are many outdated component. PHP only keep working when downgrade to 7.1. I am trying to rewrite it in modern app like reactjs, but anyway it's an good experiment on maintaining LAMP/LEMP stack with heavy JS (jQuery). And many cool functionality can be the checklist to find out good Angular or ReactJS CMS alternative.
Comments
Post a Comment