KindEditor默认提供ASP、ASP.NET、PHP、JSP上传程序,这些程序是演示程序,建议不要直接在实际项目中使用。 如果您确定直接使用本程序,使用之前请仔细确认相关安全设置。
- // ASP
- KindEditor.ready(function(K) {
- K.create('#textarea_id', {
- uploadJson : '../asp/upload_json.asp',
- fileManagerJson : '../asp/file_manager_json.asp',
- allowFileManager : true
- });
- });
- // ASP.NET
- KindEditor.ready(function(K) {
- K.create('#textarea_id', {
- uploadJson : '../asp.net/upload_json.ashx',
- fileManagerJson : '../asp.net/file_manager_json.ashx',
- allowFileManager : true
- });
- });
- // JSP
- KindEditor.ready(function(K) {
- K.create('#textarea_id', {
- uploadJson : '../jsp/upload_json.jsp',
- fileManagerJson : '../jsp/file_manager_json.jsp',
- allowFileManager : true
- });
- });
Note
具体使用方法请参见各语言(asp、asp.net、php、jsp)目录下的demo.xxx文件。
- //成功时
- {
- "error" : 0,
- "url" : "http://www.example.com/path/to/file.ext"
- }
- //失败时
- {
- "error" : 1,
- "message" : "错误信息"
- }