stinger/ckeditor-uploadwidget-bundle
A Symfony bundle that integrates CKEditor's upload widget, giving editors a simple way to upload and insert files or images. It provides the supporting backend configuration and assets needed to wire CKEditor uploads into your application.
This is a Symfony 2.x-era bundle (last release December 2015) whose only job is to ship and register the CKEditor Upload Widget plugin assets so you don't have to copy them into your project by hand. Treat it as an asset shim, not an application framework.
Minimal steps:
Install the plugin files.
composer require stinger/ckeditor-uploadwidget-bundle
You will likely need to allow the constraint manually (e.g. "stinger/ckeditor-uploadwidget-bundle": "dev-master" or "*") since it predates modern Composer/Symfony constraints.
Register the bundle in app/AppKernel.php (Symfony 2 style — this will not work with Symfony Flex / 4+):
new Stinger\CKEditorUploadWidgetBundle\StingerCKEditorUploadWidgetBundle(),
Publish the assets so the browser can fetch the plugin:
php app/console assets:install web --symlink
php app/console cache:clear
Look first at Resources/public/ inside the bundle (via vendor/stinger/ckeditor-uploadwidget-bundle/). That folder contains the actual plugin.js, CSS, and icon that CKEditor loads. Confirm the plugin folder name (typically uploadwidget) so you reference it correctly in step 5.
First use case — enable the plugin in CKEditor and point uploads at your own endpoint:
CKEDITOR.replace('editor', {
extraPlugins: 'uploadwidget',
uploadUrl: '/upload/ckeditor', // your Symfony route
filebrowserUploadUrl: '/upload/ckeditor'
});
The plugin now gives editors drag-and-drop / paste image uploads inside CKEditor, with the actual byte handling done by your controller.
The bundle does no upload handling itself — it only makes the client-side widget available. That distinction is the single most important thing to internalize before you start.
1. Asset-reference pattern (the bundle's real value).
Instead of hardcoding a path to web/bundles/stingerckeditoruploadwidget/..., reference the bundle assets in your Twig layout after assets:install:
<script src="{{ asset('bundles/stingerckeditoruploadwidget/plugin.js') }}"></script>
or rely on CKEditor's own plugin loader by setting CKEDITOR.basePath / extraPlugins and letting it resolve plugins/uploadwidget/plugin.js. Check the bundle's Resources/views and Resources/config for the exact alias it registers.
2. Upload endpoint pattern. Because the plugin is client-only, the standard integration is:
multipart/form-data (field name is conventionally upload for this plugin — verify against plugin.js).move_uploaded_file into web/uploads).{ "uploaded": 1, "fileName": "photo.jpg", "url": "/uploads/photo.jpg" }
The exact response contract lives in the plugin's plugin.js — open it and read onUploadResponse/success handlers before writing the controller. This is the number-one place integrations break.3. Form-field wiring.
Pair it with your CKEditor form type (FOSCKEditorBundle, Ivopetkov, or a hand-rolled CKEditorType) by passing the uploadUrl option through the widget config:
$builder->add('body', CKEditorType::class, [
'config' => [
'extraPlugins' => 'uploadwidget',
'uploadUrl' => '/upload/ckeditor',
],
]);
Keep the URL route name in a constant so the JS config and the routing file never drift.
4. Multiple editors / per-editor config.
The plugin reads its upload target from the editor instance config, so you can vary uploadUrl per editor (e.g. a public comment editor vs. an admin editor) without touching the bundle — good for tiered permissions.
5. Security integration.
Guard the upload action with the same security.yml firewall as the rest of your admin, and validate MIME type and size server-side. The 2015 plugin has no CSRF awareness of its own, so either append a token to uploadUrl or whitelist the route in your CSRF config.
6. When to fork instead of depend.
Given the package has effectively zero dependents and no releases since 2015, the sustainable pattern is to copy Resources/public/ into your own web/js/ckeditor/plugins/uploadwidget/ once, drop the Composer dependency, and own the plugin. You keep the working CKEditor integration without carrying an abandoned Symfony 2 bundle.
AppKernel, app/console, web/). It will not autoload or boot under Symfony 3.4+/4+/5+ without edits. If you're on a modern Symfony, don't fight the bundle — extract the assets and register them yourself.assets:install is the classic failure — CKEditor silently drops extraPlugins: 'uploadwidget'' if it can't fetch plugin.js, and you get no error in the editor. Open the browser Network tab and confirm the plugin.js request returns 200.extraPlugins must match the folder name inside Resources/public/. Inspect the directory; don't assume uploadwidget.uploaded: 0). A plain Symfony JsonResponse with different keys will make uploads "succeed" on the wire but show an error in the editor. Echo the plugin's own expectations exactly.uploadUrl at a route that requires an authenticated session works only if cookies are sent — they are by default, but if you use a separate CDN/subdomain for the editor, CORS will bite you.CKEDITOR.instances.editor.plugins.uploadwidget) and the network panel. Add temporary console.log in plugin.js if needed.assets:install or editing plugin.js, hard-refresh the browser and cache:clear the Symfony side; CKEditor caches plugin registration per page load.app/Resources/StingerCKEditorUploadWidgetBundle/ rather than editing vendor files — the standard Symfony 2 bundle override still applies.How can I help you explore Laravel packages today?