helloflask / flask-ckeditor

CKEditor integration for Flask, including image upload, code syntax highlight, and more.
https://flask-ckeditor.readthedocs.io
MIT License
200 stars 67 forks source link

HTTP error occurred during file upload (error status: 400) #26

Closed bekab95 closed 4 years ago

bekab95 commented 4 years ago

Can not upload image everything is as in example

bekab95 commented 4 years ago

As I found the problem is in CSRF and can not attach CSRF token by $.ajaxsetup

greyli commented 4 years ago

Which example application are you using? If you want to enable CSRF protection, you have to uncomment line 15, line 23 and line 29 in image-upload example.

bekab95 commented 4 years ago

Thanks but it is not working in flask admin

bekab95 commented 4 years ago

Please try a minimal app and flask admin together and see if CSRF is problem

greyli commented 4 years ago

OK, I will try to add an example for Flask-Admin with image upload.

greyli commented 4 years ago

Example app added here, you can uncomment the related 3 lines in app.py to enable CSRF protection.

AimanMRT commented 2 years ago

Untitled this is same problem?? cannot browse from server using ckeditor..cannot send to server.. ckeditor and kcfinder..

Ashwinch commented 2 years ago

AimanMRT

Were you able to find resolution for this, I am facing the same issue.