2 years ago

Implementing summernote and uploading image issue

Posted 2 years ago by agilasadi

I'm trying to upload images withing the summernote, the problem is, when i return the filename after upload, i can not insert it in the editor, like it does return the name, i can output it in console but does not add up to the rest of path. here is the code

        height: 400,
        callbacks: {
            onImageUpload: function(file, editor, welEditable) {
                uploadImage(file[0], editor, welEditable);

    function uploadImage(file, editor, welEditable) {
        var data = new FormData();
        data.append("file", file);
        data.append("_token", globalToken);
        data.append("article_token", article_token);
            type: "POST",
            url: uploadArticleImages,
            data: data,
            success: function(url) {
                var image = $('<img>').attr('src','http://localhost/appName/public/storage/article_resim/' + url);
                $('#texteditor').summernote("insertNode", image[0]);

            cache: false,
            contentType: false,
            processData: false,
            error: function(data) {

the url i receive for the image is


but it shows me the actuall filename in the console with "url"

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