Recently in the Kindeditor editor, when uploading local images encountered some problems, can not upload correctly.
Now make a note of the configuration of uploading local images using Kindeditor.
1, download kindeditor. http://kindeditor.net/down.php
2, unzip, copy all files to the project. I put it in the content.
(You can delete the following directory as required after uploading to the server, asp-asp program, asp.net-asp.) NET programs, php-php programs, jsp-jsp programs, examples-demo files)
3 . Copy the DLL files from the Editor/asp.net/bin directory to the project Bin directory.
4. Modify HTML page
a> add textarea input box
<td> @Html. textareafor (A = a.contents, new {id = "editor_id"}) </td><!--or <td><textarea id= "editor_id" name= "Contents" >Model.contents</textarea>-
b>Add the following script to the page
<script charset= "Utf-8" src= "~/content/editor/kindeditor.js" ></script> <script charset= "Utf-8" src= " ~/content/editor/lang/zh_cn.js "></script> <script> kindeditor.ready (function (K) {win Dow.editor = k.create (' #editor_id ', {width: ' 600px ', Height: ' 400px ', items: [' Source ', ' | ', ' undo ', ' Redo ', ' | ', ' preview ', ' print ', ' template ', ' cut ', ' copy ', ' Paste ', ' | ', ' Justifyleft ', ' justifycenter ', ' justifyright ', ' | ', ' insertorderedlist ', ' insertunorderedlist ', ' C Learhtml ', ' quickformat ', ' | ', ' anchor ', ' link ', ' unlink ', ' | ', ' fullscreen ', '/', ' Formatblock ', ' fontname ', ' fontsize ', ' | ', ' forecolor ', ' hilitecolor ', ' bold ', ' Italic ', ' u Nderline ', ' lineheight ', ' removeformat ', ' | ', ' image ', ' multiimage ', ' flash ', ' media ', ' insertfile ' , '|', ' Table ', ' hr ', ' emoticons ', ' baidumap '],//uploadjson: ' ~/content/editor/asp.net/upload_json.ashx ', In the online need to configure this sentence, but the comments are not error ... Only the following filemanagerjson are required: ' ~/content/editor/asp.net/file_manager_json.ashx ',}); }); </script>
If you change the file location of editor, modify the save path of Upload_json.ashx and File_manager_json.ashx. Mine is the default.
Find the image folder under the Plugins folder, there is a image.js file, the default is PHP, to be modified to ASP.
When uploading a local image, the path displays c:\fakepath\***, showing that the Fakepath is normal and is unable to obtain a real path for security reasons.
The Last:
. NET MVC uses Kindeditor to upload local images