[CKEditor Dev] #13650: Ruby on Rails - Drag and drop image upload not working

218 views
Skip to first unread message

CKEditor

unread,
Aug 12, 2015, 9:55:20 PM8/12/15
to ckeditor...@googlegroups.com
#13650: Ruby on Rails - Drag and drop image upload not working
----------------------+------------------------------------------
Reporter: CptMaumau | Owner:
Type: Bug | Status: new
Priority: Normal | Component: General
Version: 4.5.2 | Keywords: Drag and Drop, Ruby on Rails
----------------------+------------------------------------------
== Steps to reproduce ==

1. Launch Rails server
2. Launch editor
3. 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.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13650>
CKEditor <http://ckeditor.com/>
The text editor for the Internet

CKEditor

unread,
Aug 13, 2015, 3:21:43 AM8/13/15
to ckeditor...@googlegroups.com
#13650: Ruby on Rails - Drag and drop image upload not working
------------------------+--------------------
Reporter: CptMaumau | Owner:
Type: Bug | Status: closed
Priority: Normal | Milestone:
Component: General | Version:
Resolution: invalid | Keywords:
------------------------+--------------------
Changes (by Reinmar):

* status: new => closed
* keywords: Drag and Drop, Ruby on Rails =>
* version: 4.5.2 =>
* resolution: => invalid


Comment:

The error that you paste means that your backend does not work (the route
does not exist). That's not CKEditor's bug.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13650#comment:1>

CKEditor

unread,
Aug 13, 2015, 3:29:00 AM8/13/15
to ckeditor...@googlegroups.com
#13650: Ruby on Rails - Drag and drop image upload not working
------------------------+--------------------
Reporter: CptMaumau | Owner:

Type: Bug | Status: closed
Priority: Normal | Milestone:
Component: General | Version:
Resolution: invalid | Keywords:
------------------------+--------------------

Comment (by CptMaumau):

But isn't it abnormal to have a url format like that?

Shouldn't it be: /ckeditor/pictures?responseType=json

--
Ticket URL: <http://dev.ckeditor.com/ticket/13650#comment:2>

CKEditor

unread,
Aug 13, 2015, 3:33:38 AM8/13/15
to ckeditor...@googlegroups.com
#13650: Ruby on Rails - Drag and drop image upload not working
------------------------+----------------------
Reporter: CptMaumau | Owner:
Type: Bug | Status: reopened

Priority: Normal | Milestone:
Component: General | Version:
Resolution: | Keywords:
------------------------+----------------------
Changes (by Reinmar):

* status: closed => reopened
* resolution: invalid =>


Comment:

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.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13650#comment:3>

CKEditor

unread,
Aug 13, 2015, 4:48:45 AM8/13/15
to ckeditor...@googlegroups.com
#13650: Ruby on Rails - Drag and drop image upload not working
------------------------+----------------------
Reporter: CptMaumau | Owner:

Type: Bug | Status: reopened
Priority: Normal | Milestone:
Component: General | Version:
Resolution: | Keywords:
------------------------+----------------------

Comment (by pjasiun):

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.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13650#comment:4>

CKEditor

unread,
Aug 13, 2015, 4:55:25 AM8/13/15
to ckeditor...@googlegroups.com
#13650: Ruby on Rails - Drag and drop image upload not working
--------------------------------------+-----------------------
Reporter: CptMaumau | Owner:
Type: Bug | Status: confirmed
Priority: Normal | Milestone:
Component: Documentation & Samples | Version:
Resolution: | Keywords:
--------------------------------------+-----------------------
Changes (by j.swiderski):

* status: reopened => confirmed
* component: General => Documentation & Samples


--
Ticket URL: <http://dev.ckeditor.com/ticket/13650#comment:5>

CKEditor

unread,
Aug 17, 2015, 2:49:31 AM8/17/15
to ckeditor...@googlegroups.com
#13650: Ruby on Rails - Drag and drop image upload not working
--------------------------------------+-----------------------
Reporter: CptMaumau | Owner:

Type: Bug | Status: confirmed
Priority: Normal | Milestone:
Component: Documentation & Samples | Version:
Resolution: | Keywords:
--------------------------------------+-----------------------

Comment (by CptMaumau):

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.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13650#comment:6>

CKEditor

unread,
Aug 17, 2015, 3:27:26 AM8/17/15
to ckeditor...@googlegroups.com
#13650: Ruby on Rails - Drag and drop image upload not working
--------------------------------------+-----------------------
Reporter: CptMaumau | Owner:

Type: Bug | Status: confirmed
Priority: Normal | Milestone:
Component: Documentation & Samples | Version:
Resolution: | Keywords:
--------------------------------------+-----------------------

Comment (by pjasiun):

This is a CKEditor bug tracker, not a support channel. The open support
channel for CKEditor is [http://stackoverflow.com/ Stack Overflow]. Also
note that your question is about the Ruby on Rails plugin, CKEditor do not
have any `authenticity_token`, as far as I know.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13650#comment:7>

CKEditor

unread,
Aug 17, 2015, 4:05:19 AM8/17/15
to ckeditor...@googlegroups.com
#13650: Ruby on Rails - Drag and drop image upload not working
--------------------------------------+-----------------------
Reporter: CptMaumau | Owner:

Type: Bug | Status: confirmed
Priority: Normal | Milestone:
Component: Documentation & Samples | Version:
Resolution: | Keywords:
--------------------------------------+-----------------------

Comment (by Reinmar):

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.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13650#comment:8>

CKEditor

unread,
Aug 17, 2015, 5:00:46 AM8/17/15
to ckeditor...@googlegroups.com
#13650: Ruby on Rails - Drag and drop image upload not working
--------------------------------------+--------------------
Reporter: CptMaumau | Owner:
Type: Bug | Status: closed

Priority: Normal | Milestone:
Component: Documentation & Samples | Version:
Resolution: fixed | Keywords:
--------------------------------------+--------------------
Changes (by pjasiun):

* status: confirmed => closed
* resolution: => fixed


Comment:

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.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13650#comment:9>

Reply all
Reply to author
Forward
0 new messages