Summernote - Image url instead of Base64 MVC

匿名 (未验证) 提交于 2019-12-03 02:38:01

问题:

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" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!