Kindeditor: An error occurred while uploading images. An error occurred while uploading images.

Source: Internet
Author: User

Your website is encoded with gb2312, which is made by ASP.

The background HTML compiler of ewebeditor was used. After a new space is used, the compiler fails to upload images.

I searched for ewebeditor-related information on the Internet and found that there were very few materials. It took too much time to study myself. ewebeditor does not support non-ie browsers. Use another HTML background editor.

 

I searched several well-known background editors on the Internet, as shown below:

Ckeditor http://www.oschina.net/p/ckeditor FCKeditor (ckeditor is a new version of FCKeditor, but ckeditor itself does not have Image Upload and file upload functions, need to install paid kcfinder, a little trouble)

Tinymce http://www.oschina.net/p/tinymce)

Kindeditor http://www.oschina.net/p/kindeditor (this interface is not bad, also with picture upload,That's all.)

 

======================================

Ckeditor is a new generation of FCKeditor, which is a redevelopment version. Ckeditor is one of the world's best online web text editors. It is widely used in various websites for its amazing performance and scalability.

The available extensions include the File Manager kcfinder.

Online Demo: http://ckeditor.com/demo

======================================

Kindeditor usage:

Official: http://www.kindsoft.net/docs/usage.html

I can set the relevant parameters myself. Now, the official website and the internet provide PHP examples, not ASP. I need to modify them myself. I didn't notice it at first.

<SCRIPT> kindeditor. ready (function (k) {// global configuration var serverscriptpath = '/Editor/asp/'; // absolute URL path of the server file folder, finally, you must have/var editorpluginspath = "/Editor/plugins/"; // the absolute path of the plug-in folder URL of the editor. Finally, you must have the // global configuration to end var editor1 = K. create ('textarea [name = "editor_id"] ', {// specify textarea // do not change uploadjson: serverscriptpath + 'upload _ JSON. ASP ', filemanagerjson: serverscriptpath + 'file _ upload', csspath: editorpluginspath + 'Code/prettify.css', emoticonspath: editorpluginspath + "/emoticons/images /", // do not change the end allowfilemanager: true}) ;}); </SCRIPT>

Remember to introduce two JS files. You can find them in the downloaded package.

<script charset="utf-8" src="../editor/kindeditor.js"></script><script charset="utf-8" src="../editor/lang/zh_CN.js"></script>

You need to put a text box in the called area to display the editor.

<Textarea id = "editor_id" name = "content" style = "width: 700px; Height: 300px;"> <strong> HTML content </strong> </textarea>

========================

Some problems may occur when uploading images.

1, reference address: http://www.stepday.com/topic? 256

 

When I upload an image using the kindeditorhtml editor, the following error occurs: 'savetofile (...)'. After multiple queries, the system finally located the error point.

Set result = file. savetofile (savepath, 0, true)


Modify the code above it

File. savetofile savepath, 0, true

 

You can upload the file correctly.

2, reference address: http://www.stepday.com/topic? 257

I think programmers who develop websites are no stranger to the kindeditor editor. It is a very powerful editor and lightweight. Written in combination with pure jquery + CSS, the deployment environment is very simple and quick. Demo for download on the official website of kindeditor, but the default is Php demo. So how can ASP be used in its own website projects? We need to do the following.

1. Set the path for uploading ASP files

We can set the path value in two places:

1) Modify row 15th in/kindeditor/plugins/images/image. js


2) modify the page embedded in kindeditor and write the ASP address of the uploaded file. It is best to write the relative path instead of using the form .../.


2. Modify the upload_json.asp File

 

'If the upload succeeds, return true; otherwise, return falseresult = file. savetofile (savepath, 0, true) If result = false thenresponse. Write ("") response. endend if

3. Modify the upload_class.asp File

Modify rows 518 and 520 in the savetofile function in upload_class.asp as follows:

 

IfNotErrThenSaveToFile=trueElseSaveToFile=falsemException=Err.DescriptionEndIf

Kindeditor no component File Upload (ASP) package:

==========================================

My summary

If the program prompts that an invalid string has ended, it is because ASP on the official website uses utf8 encoding, which is in conflict with my asp gb2312 encoding. After converting ASP in the downloaded package into gb2312 encoding, there is no prompt for the end of the invalid string. The figure is no longer captured.

Another problem is that the savetofile error is prompted during the upload. Follow the above prompt to modify it.

Finally, the problem of uploading images is solved locally. Why does the official website not provide a detailed ASP tutorial? There are still problems with the current version.

This kind of things should be downloaded and used. It takes me so much time to get stuck.

============================================

By default, images are uploaded in a path like/image/yymmdd/yymmdd1_rand.jpg. If you want to remove the yymmdd directory, you can modify the upload_json.asp file.

In row 77th

savePath = savePath & ymd & "/"
saveUrl = saveUrl & ymd & "/"

Comment out the two rows.

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.