Home Summernote - Image url instead of Base64 MVC
Reply: 0

Summernote - Image url instead of Base64 MVC

tom clack
1#
tom clack Published in 2018-01-11 08:15:04Z

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/2wCEAAkGBxMSEhUSERMWFRUVERUVEBUWFRUVFRYVFRUWFxUVFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGhAQGi0lHyUtLS0tLS0tLSstLS0tKy0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAKgBKwMBEQACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAEAQIDBQYABwj...........>

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>

 <input type="submit" value="Add" id="editorbtn" class="btn btn-primary" />
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.377582 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO