ckeditor base64 images

27 views
Skip to first unread message

Austin

unread,
Dec 10, 2020, 8:25:44 PM12/10/20
to sakai-dev
Hello Sakai Devs,

Is there any way to NOT have ckeditor save pasted in images (or source with base64) as an embedded base64 image?  And instead, automatically add the image to resources and have the ckeditor source link to it?

This plugin looks like it might have some of those features:


In our case, we have a class that uses Etudes Meme - Assignments, Tests, Surveys (but I suspect this could happen with Samigo too) and it has 1000s of questions in several question pools.  Many of those questions contain base64 images, which I suspect the instructor pasted into ckeditor.  And I think because of the base64 images, we're seeing some slow queries accessing that tool for that site.

Also, that instructor imports those tests from one semester to the next so the problem continues to happen each semester.  It would be great if we could automatically convert those existing base64 images into an actual file in resources and link to it from the test. (otherwise, we'd have to ask the instructor to manually convert each image into a resources image link)

I also suspect that many sites have pasted in bas64 images into their Overview tool -> Worksite Information.

Further, when I've analyzed Heap Dumps, there are lots of objects in memory that look like base64 images, which I suspect come from the examples above.

Thanks,

Austin


Jesus Maria Mendez Perez

unread,
Dec 11, 2020, 3:04:18 AM12/11/20
to Austin, sakai-dev
Hi Austin,

We did this PR https://github.com/sakaiproject/sakai/pull/8578/files to allow pasting images on base64.
No news since September so we decided to close it.

Please, take a look.

Regards Jesus.

--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CAKL84%3Dk3UPVyigz6ZwdAuH_Y%2BXo%3Db2xfXK7WVR%2BoGkJ3QBUC5Q%40mail.gmail.com.

Austin

unread,
Dec 11, 2020, 1:13:38 PM12/11/20
to sakai-dev
Hello Jesus,

Sorry, we'd like to prevent base64 images. (I've edited this post's subject)  That plugin sounds like it allows for base64?  Or am I'm misunderstanding the plugin?

Matthew Jones

unread,
Dec 13, 2020, 12:08:28 PM12/13/20
to Austin, sakai-dev
Yeah the plugin there was to allow drag and drop of images to base64.

I do remember looking at plugins in the past that would take the image and upload it somewhere, but I Sakai doesn't have any great place to upload files like this to. There's been some FARM features out there for improving where course related files (like attachments) are uploaded and accessible from. 

  • It could upload it to the users Home->Resources, but then access wouldn't be allowed directly to other users
  • It could upload it to some public folder in Home->Resources but then it wouldn't be related to the class.
  • It could like the Math and Audio recordings store them in a special user inaccessible area like attachments, but then these aren't duplicated when a course is copied and an instructor can't delete them. (At least I believe this still isn't the case)
  • If an instructor uploads them, it could put them in a special hidden folder in the course site, but what happens when a student uploads? I guess if they didn't have access to course resources it would have to put it somewhere else.

The "best place" to put files like this feels like it's been a continuing discussion/problem. 

David P. Bauer

unread,
Dec 14, 2020, 8:46:37 AM12/14/20
to Matthew Jones, Austin, sakai-dev
This was a constant request from our users, so we pulled the trigger and added a "direct-upload" custom method to the content entity provider which we hooked into the CKEditor image plugin. Now, if you drag and drop images into the CKEditor they are sent to the current site's resources tool. We have two folders that will automatically get created if they don't exist in the current site:
  •  student-uploads -> folder for site members without "add" privileges, this folder is explicitly skipped during site duplication so that student content is not copied from site to site.
  • instructor-uploads -> folder for site members with "add" privileges. This folder in Resources is treated like any other folder.
Both of these folders are set to be hidden with accessible content so that users in the site can access the content throughout the site, but students won't be able to browse the contents in the Resources tool.

direct_upload.gif

It's probably not the best solution, but it's enabled students and instructors to add images to their content without worrying about uploading it somewhere and setting permissions first. I'm happy to share what we have if anyone wants to use it as a starting point.

David




--
David P. Bauer
Assistant Director, eLearning

University of Dayton
300 College Park, Dayton, OH 45469-1302

Austin

unread,
Dec 14, 2020, 4:00:04 PM12/14/20
to David P. Bauer, Matthew Jones, sakai-dev
Thanks David, that sounds like a good solution.  I've created https://jira.sakaiproject.org/browse/SAK-44785
If you don't mind, could you also add a comment about your solution there, please?

Thanks,

Austin
Reply all
Reply to author
Forward
0 new messages