PreviewImage.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:3k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <%
  3. Dim PreviewImagePath,FileExtName,FileIconDic,FileIcon,AvailableShowTypeStr,PicPara
  4. PreviewImagePath = Request("FilePath")
  5. AvailableShowTypeStr = "jpg,gif,bmp,pst,png,ico"
  6. Set FileIconDic = CreateObject("Scripting.Dictionary")
  7. FileIconDic.Add "txt","../Images/FileIcon/txt.gif"
  8. FileIconDic.Add "gif","../Images/FileIcon/gif.gif"
  9. FileIconDic.Add "exe","../Images/FileIcon/exe.gif"
  10. FileIconDic.Add "asp","../Images/FileIcon/asp.gif"
  11. FileIconDic.Add "html","../Images/FileIcon/html.gif"
  12. FileIconDic.Add "htm","../Images/FileIcon/html.gif"
  13. FileIconDic.Add "jpg","../Images/FileIcon/jpg.gif"
  14. FileIconDic.Add "jpeg","../Images/FileIcon/jpg.gif"
  15. FileIconDic.Add "pl","../Images/FileIcon/perl.gif"
  16. FileIconDic.Add "perl","../Images/FileIcon/perl.gif"
  17. FileIconDic.Add "zip","../Images/FileIcon/zip.gif"
  18. FileIconDic.Add "rar","../Images/FileIcon/zip.gif"
  19. FileIconDic.Add "gz","../Images/FileIcon/zip.gif"
  20. FileIconDic.Add "doc","../Images/FileIcon/doc.gif"
  21. FileIconDic.Add "xml","../Images/FileIcon/xml.gif"
  22. FileIconDic.Add "xsl","../Images/FileIcon/xml.gif"
  23. FileIconDic.Add "dtd","../Images/FileIcon/xml.gif"
  24. FileIconDic.Add "vbs","../Images/FileIcon/vbs.gif"
  25. FileIconDic.Add "js","../Images/FileIcon/vbs.gif"
  26. FileIconDic.Add "wsh","../Images/FileIcon/vbs.gif"
  27. FileIconDic.Add "sql","../Images/FileIcon/script.gif"
  28. FileIconDic.Add "bat","../Images/FileIcon/script.gif"
  29. FileIconDic.Add "tcl","../Images/FileIcon/script.gif"
  30. FileIconDic.Add "eml","../Images/FileIcon/mail.gif"
  31. FileIconDic.Add "swf","../Images/FileIcon/flash.gif"
  32. if PreviewImagePath = "" then
  33. PreviewImagePath = "../../sys_Images/DefaultPreview.gif"
  34. else
  35. FileExtName = Right(PreviewImagePath,Len(PreviewImagePath)-InStrRev(PreviewImagePath,"."))
  36. if InStr(AvailableShowTypeStr,FileExtName) = 0 then
  37. FileIcon = FileIconDic.Item(LCase(FileExtName))
  38. if FileIcon = "" then
  39. FileIcon = "../Images/FileIcon/unknown.gif"
  40. end if
  41. PreviewImagePath = FileIcon
  42. PicPara = " width=""30"" height=""30"" "
  43. else
  44. PicPara = ""
  45. end if
  46. 'Response.Write(PreviewImagePath & "<br>" &FileExtName)
  47. 'Response.End
  48. end if
  49. Set FileIconDic = Nothing
  50. %>
  51. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  52. <HTML>
  53. <HEAD>
  54. <META http-equiv="Content-Type" content="text/html; charset=gb2312">
  55. <TITLE>图片预览</TITLE>
  56. </HEAD>
  57. <BODY topmargin="0" leftmargin="0">
  58. <TABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  59.   <TR>
  60.     <TD align="center" valign="middle" width="100%" height="100%"><div align="center"><IMG <% = PicPara %> src="<% = PreviewImagePath %>"></div></TD>
  61.   </TR>
  62. </TABLE>
  63. </BODY>
  64. </HTML>