20251024 附件预览
This commit is contained in:
@@ -346,6 +346,7 @@ namespace FineUIPro.Web.AttachFile
|
||||
{
|
||||
string savedName = item.Value<string>("savedName");
|
||||
string folder = item.Value<string>("folder");
|
||||
string type = item.Value<string>("type");
|
||||
string xnUrl = AttachPath + "\\" + savedName;
|
||||
if (!string.IsNullOrEmpty(folder))
|
||||
{
|
||||
@@ -363,28 +364,41 @@ namespace FineUIPro.Web.AttachFile
|
||||
url = Funs.RootPath + "Images//Null.jpg";
|
||||
info = new FileInfo(url);
|
||||
}
|
||||
var FiletExtension = Path.GetExtension(savedName);
|
||||
if (FiletExtension == ".docx" || FiletExtension == ".pdf")
|
||||
{
|
||||
string httpUrl = BLL.AsposeWordHelper.WordToHtml(url);
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", httpUrl, "查看 -")));
|
||||
|
||||
}
|
||||
else if (FiletExtension == ".txt")
|
||||
bool isSupportType = AttachFileService.IsSupportFileType(type);
|
||||
if (isSupportType)
|
||||
{
|
||||
|
||||
url = url.Replace(Funs.RootPath, "").Replace("#", "%23");
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", url, "查看 -")));
|
||||
}
|
||||
else if (FiletExtension == ".xls")
|
||||
{
|
||||
string httpUrl = BLL.AsposeWordHelper.PriviewExcel(url);
|
||||
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", httpUrl, "查看 -")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("不支持预览", MessageBoxIcon.Warning);
|
||||
|
||||
}
|
||||
|
||||
//var FiletExtension = Path.GetExtension(savedName);
|
||||
//if (FiletExtension == ".docx" || FiletExtension == ".pdf")
|
||||
//{
|
||||
// string httpUrl = BLL.AsposeWordHelper.WordToHtml(url);
|
||||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", httpUrl, "查看 -")));
|
||||
|
||||
//}
|
||||
//else if (FiletExtension == ".txt")
|
||||
//{
|
||||
|
||||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", url, "查看 -")));
|
||||
//}
|
||||
//else if (FiletExtension == ".xls")
|
||||
//{
|
||||
// string httpUrl = BLL.AsposeWordHelper.PriviewExcel(url);
|
||||
|
||||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/Look.aspx?fileUrl={0}", httpUrl, "查看 -")));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// ShowNotify("不支持预览", MessageBoxIcon.Warning);
|
||||
//}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user