I have Symfony 2 projekt with IvoryCKEditor integrated to Sonata. Also installed couple of CKEditor plugins. I have configured basic image upload, but I need to manage also drag and drop image upload.
Uploadimage documentation says to configure uploadUrl
property.
config.extraPlugins = 'uploadimage';
config.uploadUrl = '/uploader/upload.php';
My app/config/config.yml
looks like this:
ivory_ck_editor:
default_config: default
configs:
default:
extraPlugins: "uploadimage,image2,uploadwidget,widget,widgetselection,lineutils,notificationaggregator,notification,filetools"
uploadUrl: "/admin/sonata/media/media/upload?provider=sonata.media.provider.image&responseType=json"
filebrowserBrowseRoute: admin_sonata_media_media_browser
filebrowserImageBrowseRoute: admin_sonata_media_media_browser
filebrowserImageBrowseRouteParameters:
provider: sonata.media.provider.image
filebrowserUploadRoute: admin_sonata_media_media_upload
filebrowserUploadRouteParameters:
provider: sonata.media.provider.file
filebrowserImageUploadRoute: admin_sonata_media_media_upload
filebrowserImageUploadRouteParameters:
provider: sonata.media.provider.image
plugins:
image2:
path: "/ckeditor/plugins/image2/"
filename: "plugin.js"
uploadimage:
path: "/ckeditor/plugins/uploadimage/"
filename: "plugin.js"
uploadwidget:
path: "/ckeditor/plugins/uploadwidget/"
filename: "plugin.js"
widget:
path: "/ckeditor/plugins/widget/"
filename: "plugin.js"
widgetselection:
path: "/ckeditor/plugins/widgetselection/"
filename: "plugin.js"
lineutils:
path: "/ckeditor/plugins/lineutils/"
filename: "plugin.js"
notificationaggregator:
path: "/ckeditor/plugins/notificationaggregator/"
filename: "plugin.js"
notification:
path: "/ckeditor/plugins/notification/"
filename: "plugin.js"
filetools:
path: "/ckeditor/plugins/filetools/"
filename: "plugin.js"
When uploadUrl
is /admin/sonata/media/media/uploadprovider=sonata.media.provider.image&responseType=json
error occurs
Location: plugins/filetools/plugin.js
Description: An error occurred when parsing the upload response. Text could not be parsed to JSON.
Additional data:
responseText: Upload response text.
Apparently something wrong with JSON Response, but file uploads to directory.
My question is what should uploadUrl
looks like?