question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Summernote - image url instead of base64 MVC

See original GitHub issue

Summernote editor encodes image files into Base64.I wonder if it has a option to turn this encoding option off and use ‘inserting url’ method instead. I’ve been looking for it but no great success yet. For example, instead of storing images like…

<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMj...........> it should be <img src="/Upload/apple.jpg">

Create.cshtml

<div class="form-group">
    @Html.LabelFor(model => model.long_Description, htmlAttributes: new { @class = "control-label col-md-4" })
    <div id="summernote"></div>
    <div class="col-md-10">
        @Html.TextAreaFor(model => model.long_Description, new { @id = "long_Description", @style = "display:none;", @class = "form-control" })
        @Html.ValidationMessageFor(model => model.long_Description, "", new { @class = "text-danger" })
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('#summernote').summernote(
            {
                tabsize: 2,
                height: 150
            });

        var editor = $('#long_Description').html();

        $('#summernote').html(editor);

        $('#editorbtn').hover(function () {

            var editor = $('.note-editable').html();
            $('#long_Description').html(editor);

        });

    });
</script>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tomaaccommented, Mar 26, 2019

You have to upload an actual file to a server to point to it. Base64 encoded option just encodes image into text and add to the content you are editing.

I made a quick and primitive plugin, that handles file upload with ajax: https://github.com/tomaac/summernote-ajaxfileupload

1reaction
DiemenDesigncommented, Jan 11, 2018

Another option so you don’t have to create your own code, is to check out and use elFinder. https://github.com/semplon/summernote-ext-elfinder And there’s also an example in the elFinder wiki, specifically for Summernote: https://github.com/Studio-42/elFinder/wiki/Integration-with-Multiple-Summernote-(fixed-functions)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Summernote - Image url instead of Base64 - Stack Overflow
Summernote wysiwyg editor encodes image files into Base64.
Read more >
how can we get Image url instead of Base64 using ... - MSDN
According to your description,Summernote editor will encodes image files into Base64. I guess you would like to save file in database, ...
Read more >
Summernote - image url instead of base64 MVC - CodeProject
What I have tried: Summernote editor encodes image files into Base64. I wonder if it has a option to turn this encoding option...
Read more >
Using Summernote In ASP.NET MVC (Saving Image Files ...
In this article, you will learn how to use Summernote in ASP. ... the path in Summernote to save the image URL instead...
Read more >
Deep dive - Summernote
picture : open image dialog; link : open link dialog; video : open video dialog; table : insert a table; hr : insert...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found