8 months ago

WYSIWYG image upload

Posted 8 months ago by memele

I am creating a forum and using Trumbowyg text editor for thread and comment textareas. I want my users to be able to upload images to comments and threads using Trumbowyg's upload plugin but I am having trouble understanding the documentation (

How can I allow users to add multiple images and store them in my database? I understand that I should change the serverPath to a route that would catch the image upload post request. I don't understand why the fileFieldName is set to 'image' in this example, because when I inspect it with Dev Tools the file upload input name is 'file'.

The code from Trumbowyg's documentation:

    btns: ['upload'],
    plugins: {
        // Add imagur parameters to upload plugin for demo purposes
        upload: {
            serverPath: '',
            fileFieldName: 'image',
            headers: {
                'Authorization': 'Client-ID xxxxxxxxxxxx'
            urlPropertyName: ''

Or is there an alternative WYSIWYG editor with a simpler image upload option?

Please sign in or create an account to participate in this conversation.