Opened 9 years ago
Closed 9 years ago
#13650 closed Bug (fixed)
Ruby on Rails - Drag and drop image upload not working
Reported by: | CptMaumau | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Documentation & Samples | Version: | |
Keywords: | Cc: |
Description
Steps to reproduce
- Launch Rails server
- Launch editor
- Drag and drop image
Expected result
Image successfully uploaded
Actual result
Client side: HTTP error occurred during file upload (404: File not found).
Server side: ActionController::RoutingError (No route matches [POST] "/ckeditor/pictures&responseType=json")
Other details (browser, OS, CKEditor version, installed plugins)
Firefox 39.0.3, Linux Mint 17, CKEditor 4.5.2.
plugins: lineutils,widget,autolink,sharedspace,image2,youtube,confighelper,pastefromword,autogrow,notification,notificationaggregator,filetools,uploadwidget,uploadimage
I think the bug comes from the url used to upload which has an & instead of a ? so Rails fail in interpreting the request.
Change History (9)
comment:1 Changed 9 years ago by
Keywords: | Drag and Drop Ruby on Rails removed |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Version: | 4.5.2 |
comment:2 Changed 9 years ago by
But isn't it abnormal to have a url format like that?
Shouldn't it be: /ckeditor/pictures?responseType=json
comment:3 Changed 9 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
You're right. I missed that. I recall that there's some tricky situation with which config option you use (I guess you used filebrowserUploadUrl or filebrowserImageUploadUrl). I'll pass this to my colleague.
comment:4 Changed 9 years ago by
You should use uploadUrl
instead of filebrowserUploadUrl
. uploadUrl
is the proper configuration for image upload. filebrowserUploadUrl
is the old configuration for a filebrowser plugin and it adds &responseType=json
and is used by image upload only because of the backward compatibility with some file browsers.
I will add a comment to the filebrowserUploadUrl
config to make it clear.
comment:5 Changed 9 years ago by
Component: | General → Documentation & Samples |
---|---|
Status: | reopened → confirmed |
comment:6 Changed 9 years ago by
Thank you for the response.
I have now another issue, when I try to drag and drop an image on the server side it raises: WARNING: Can't verify CSRF token authenticity
This is due to the request not sending an authenticity_token.
Maybe this is an error from the gem I am using so I will also notify them.
comment:7 Changed 9 years ago by
This is a CKEditor bug tracker, not a support channel. The open support channel for CKEditor is Stack Overflow. Also note that your question is about the Ruby on Rails plugin, CKEditor do not use any authenticity_token
, as far as I know.
comment:8 Changed 9 years ago by
The implementation of CSRF has of course nothing to do with CKEditor. It needs to be done by the backend. CKEditor, however, perhaps needs to integrate with this too (to use the CSRF) and for that the http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-fileUploadRequest event may be used.
comment:9 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
I have updated docs, I have added note to the filebrowserUploadUrl
configuration options. I will be available in docs.ckeditor.com
after the docs rebuild.
The error that you paste means that your backend does not work (the route does not exist). That's not CKEditor's bug.