Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AbdulBazith's avatar

where the images uploaded in tinymce are stored? and in what format it is stored?

Guys iam working with online examination project.

As it was an examination based project teachers need to store the question in database.The question is not a pure text format. the question may contain half text, half image, half maths physics equation etc. so the question is mixture of images, texts, tables, equations formulae etc. for this i need an editor to add this. when i referred in google i found tinymce is best.

In what format the image is stored in db?? is there any file location?

few of my friends said it is stored in the table column as base64 (for images) and html entitied. is this right?? else we need to give path to the file location??

1)how to integrate tinymce in my project.

init-tinymce.js

tinymce.init({
    selector: 'textarea.tinymceeditor',

    plugins: ['advlist autolink lists link image charmap print preview anchor', 'searchreplace visualblocks code fullscreen', 'insertdatetime media table paste code help wordcount', ],

    external_plugins: {
        tiny_mce_wiris: 'https://www.wiris.net/demo/plugins/tiny_mce/plugin.js'
    },

    toolbar: 'tiny_mce_wiris_formulaEditor',
});

my header page

<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>

<script type="text/javascript" src="{{ URL::asset('tinymce/init-tinymce.js') }}"></script>

so after i done all these i can see the editor in my web form everything is fine. But i need to add the bold word, italic word, images equations everything in database for that i need to make the column anything?? means now the column is in data type

is this format right? or do i need to change the question_description column data type to some other in the table?

if everything goes to database whether it will be retrieved correctly? do i need to do something else in my code? if i insert an image how it will be stored in db, where it will be stored, how it will be retrieved?

i need maths equation in my project so that i referred google and i added wiris plugin

external_plugins: { tiny_mce_wiris: 'https://www.wiris.net/demo/plugins/tiny_mce/plugin.js' },

how to integrate a text editor in my project?

whether i need to change the database column into any datatype? whether the mixture of question will be stored in db correctly? how it is retrieved in the view form? need math equation?

0 likes
1 reply
m7vm7v's avatar

Looks like tinymce expects images_upload_url in its init specifying what the upload url would be. Create a route for it in your backend for storing the image. https://www.tiny.cloud/docs/configure/file-image-upload/

Also look at https://www.tiny.cloud/docs-4x/general-configuration-guide/upload-images/

"Local images can be uploaded to TinyMCE through the use of the new editor.uploadImages() function. This functionality is handled asynchronously, meaning that it is possible for users to save their content before all images have completed uploading. If this occurs, no server path to the remote image is available, and the images are saved as Base 64.

It is recommended that the editor.uploadImages() function be executed before submitting the editor contents to the server, to avoid saving content as Base 64."

1 like

Please or to participate in this conversation.