PicUpLoad.asp
上传用户:jiajie98
上传日期:2020-04-24
资源大小:1206k
文件大小:3k
源码类别:

网格计算

开发平台:

PHP

  1. <!--#Include File="AdminCheck.asp"-->
  2. <!--#Include File="../Class/Cls_Upload.asp"--><%
  3. '==========================================
  4. '文 件 名:PicUpLoad.asp
  5. '文件用途:文件上传
  6. '系统开发:方卡在线
  7. '==========================================
  8. %>
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  12. <title>上传图片</title>
  13. <style type="text/css">
  14. <!--
  15. body,td,th {
  16. font-size: 12px;
  17. }
  18. body {
  19. margin-left: 0px;
  20. margin-top: 0px;
  21. margin-right: 0px;
  22. margin-bottom: 0px;
  23. }
  24. a {
  25. font-size: 12px;
  26. color: #000;
  27. }
  28. a:link {
  29. text-decoration: none;
  30. }
  31. a:visited {
  32. text-decoration: none;
  33. color: #000;
  34. }
  35. a:hover {
  36. text-decoration: none;
  37. color: #333;
  38. }
  39. a:active {
  40. text-decoration: none;
  41. color: #000;
  42. }
  43. .Input,.Button {
  44. height:20px;
  45. line-height:20px;
  46. border:1px solid #999;
  47. border-bottom:1px solid #CCC;
  48. border-right:1px solid #CCC;
  49. }
  50. .Button {
  51. margin-left:0;
  52. }
  53. -->
  54. </style></head>
  55. <body>
  56. <%
  57. Call UpPic()
  58. '==============================
  59. '函 数 名:UpPic
  60. '作    用:上传图片
  61. '参    数:
  62. '==============================
  63. Sub UpPic()
  64. If Request.QueryString("Submit")="Pic" Then
  65. Dim UploadPath,UploadPath2,UploadSize,UploadType,UpRequest,AutoSave,Size,ShowSize,Str
  66. UploadPath="../Up/"
  67. UploadPath2="Up/"
  68. UploadSize="10240"
  69. UploadType="jpg/gif/png/bmp/rar/zip/doc/xls/ppt"
  70. Set UpRequest=New UpLoadClass
  71. UpRequest.SavePath=UploadPath
  72. UpRequest.MaxSize=UploadSize*1024 
  73. UpRequest.FileType=UploadType
  74. AutoSave=true
  75. UpRequest.Open
  76. If UpRequest.Form("file_Err")<>0  Then
  77. Select Case UpRequest.Form("file_Err")
  78. Case 1:Str="<div style=""padding-top:5px;padding-bottom:5px;""> <font color=blue>上传不成功!文件超过"&UploadSize&"k [<a href='javascript:history.go(-1)'>重新上传</a>]</font></div>"
  79. Case 2:Str="<div style=""padding-top:5px;padding-bottom:5px;""> <font color=blue>上传不成功!文件格式不对 [<a href='javascript:history.go(-1)']>重新上传</a>]</font></div>"
  80. Case 3:Str="<div style=""padding-top:5px;padding-bottom:5px;""> <font color=blue>上传不成功!文件太大且格式不对 [<a href='javascript:history.go(-1)'>重新上传</a>]</font></div>"
  81. End Select
  82. Response.Write Str
  83. Else
  84. Response.Write "<script language=""javascript"">parent."&Request.QueryString("Form")&"."&Request.QueryString("Input")&".value='"&SiteDir&UploadPath2&UpRequest.Form("File")&"';" 
  85. Response.Write "parent.PhotoShow.innerHTML='<img src="""&SiteDir&UploadPath2&UpRequest.Form("File")&""" width=""200"" height=""200"" />';" 
  86. Response.Write "</script>"
  87. Size=UpRequest.Form("file_size")
  88. ShowSize=Size & " Byte"   
  89. If Size>1024 Then  
  90. Size=(Size1024)  
  91. ShowSize=Size & " KB"  
  92. End If  
  93. If Size>1024 Then  
  94. Size=(Size/1024)  
  95. ShowSize=FormatNumber(Size,2) & " MB"   
  96. End If 
  97. Response.Write "<div style=""padding-top:5px;padding-bottom:5px;""> <font color=red>文件上传成功</font> [<a href='javascript:history.go(-1)'>重新上传</a>]</div>"
  98. End If
  99. Set UpRequest=nothing
  100. End If
  101. Response.Write "<Form name=Form action='?Submit=Pic&Form="&Request.QueryString("Form")&"&Input="&Request.QueryString("Input")&"' method=post enctype=multipart/Form-data>"
  102. Response.Write "<input type='file' name='file' class='Input' Size='20'>&nbsp;"
  103. Response.Write "<input type='submit' name='submit' value='上传' class=""Button"">"
  104. Response.Write "</Form>"
  105. End sub
  106. %>
  107. </body>
  108. </html>