网站环境:asp.net 2.0 + vs 2008
kindeditor版本:3.4.2
Managefile_json.cs文件代码如下:
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.IO;
public partial class Managefile_json: System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Clear();
Response.ContentType = "application/json;";
Response.Charset = "UTF-8";
string currentPath = "../../UploadFiles/";
StringBuilder sb = new StringBuilder();
sb.Append("{\"moveup_dir_path\":\"\",");
sb.Append("\"current_dir_path\":\"" + currentPath + "\",");
sb.Append("\"current_url\":\"" + currentPath + "\",");
string[] files = System.IO.Directory.GetFiles(@Server.MapPath("" + currentPath));
sb.Append("\"total_count\":" + files.Length + ",");
sb.Append("\"file_list\":[");
for (int i = 0; i < files.Length; i++)
{
FileInfo file = new FileInfo(files[i]);
sb.Append("{\"is_dir\":false,\"has_file\":false,\"filesize\":" + file.Length + ",\"dir_path\":\"\",\"is_photo\":true,\"filetype\":\"" + file.Extension + "\",\"filename\":\"" + file.Name + "\",\"datetime\":\"" + file.CreationTime + "\"}");
if (i != files.Length - 1)
{
sb.Append(",");
}
}
sb.Append("]}");
Response.Write(sb.ToString());
}
}
故障:
打开网络文件夹后图像的缩略图一律是带×的图标,加载到kindeditor中也是带×的图标。
我在本机电脑上传这些图片都没有问题,上传时没有输入图像宽高等信息。
请大家给点提示,谢谢!