Firefox allows desktop image files to be dragged in to CKEditor
I have an instance of CKEditor running and in Firefox (reproduced in 3.6,4,5) when an image file is dragged from the desktop开发者_如何学JAVA in to the web app CKEditor text area, it inserts the image data in base64 format.
<img src="data:image/png;base64,iVBORw0KGg...
This is causing a misleading experience for my users as they think an image is being uploaded directly in to their post since the image will actually render in the content area. When they go to submit the post it fails, due to either being too large or not passing the content filters we have in place.
Drag and drop isn't in the current scope for the project (and we'd find a better way if it were) so anything that can completely block this behavior would be preferred.
Any ideas?
Have you tried "Bamboo Cane"...
With Bamboo Cane you can whip the user in either the chest or the neck every time you catch them behaving in this way. It may seem a little drastic but will get the point across very quickly, works especially well in team environment situations :-)
On a more serious note the only thing I can think of is setting up some kind of setInterval() time out which looks for IMG tag and then doing indexOf on "data:image/png;" and if you find that then do a remove on the element...
(Let me know if you need code for that...)
But ultimately a nice user PDF guide might be the real trick, often if you build some kind of CMS then you should provide a How To guide... or in this case a How NOT to guide.
I found this on the web Blog Drag-Drop image ... CKEditor using Firefoy.
It works fine for me so you could give it a try.
精彩评论