wy_upload2.asp
上传用户:hnxqingdao
上传日期:2013-05-22
资源大小:1283k
文件大小:2k
源码类别:

其他行业

开发平台:

ASP/ASPX

  1. <!--#include FILE="wy_upload_inc.asp"-->
  2. <html>
  3. <head>
  4. </head>
  5. <style>
  6. body { font-size:9pt  }
  7. </style>
  8. <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  9. <script>
  10. if (top.location==self.location){
  11. top.location="upload.asp"
  12. }
  13. </script>
  14. <%
  15. set upload=new upload_5xsoft
  16. set file=upload.file("sf_upfile")
  17. if file.fileSize<1 then
  18.    response.write"<script language=javascript>alert('您没有选择图片。~~~nn-----请点击浏览按钮,从弹出的窗口中选择要上传的图片。nn-----然后点击上传按钮就可以把图片上传了...nn-----不过要注意图片的格式哦~~~');history.back()</script>"
  19.    response.end 
  20. end if
  21. if file.fileSize<10 or file.fileSize>1000*1024 then
  22. response.write "错误:上传的图片大小超过了限制! <a href='javascript:history.go(-1)'>退回上一步</a>"
  23. response.end
  24. end if
  25. upfilename = split(file.FileName,".")
  26. upfileext = upfilename(ubound(upfilename))
  27. if upfileext<>"jpg" and upfileext<>"jpeg" and upfileext<>"gif" and upfileext<>"JPG" and upfileext<>"JPEG" and upfileext<>"GIF"then
  28. response.write "错误:上传的文件格式不对! <a href='javascript:history.go(-1)'>退回上一步</a>"
  29. response.end
  30. end if
  31. if request.QueryString("up") = "logo" then
  32. ufp="GG_logo_"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&"."&upfilename(ubound(upfilename))
  33. else
  34. ufp="news_"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&"."&upfilename(ubound(upfilename))
  35. end if
  36. ' file path
  37. file.saveas Server.mappath("../../wy_trip_images/"&ufp)
  38. %>
  39. <script >
  40. parent.frmadd.news_content.value+='wy_trip_images/<%=ufp%>'
  41. //location.replace('../wy_trip_admin.asp')
  42. </script>
  43. <%
  44. solname=request.QueryString("solname")
  45. tablename=request.QueryString("tablename")
  46. solpic=request.QueryString("solpic")
  47. pp="wy_updata.asp?name="&ufp
  48. pp=pp&"&tablename="&tablename
  49. pp=pp&"&solname="&solname
  50. pp=pp&"&solpic="&solpic
  51. response.redirect(pp)
  52. set file=nothing
  53. set upload=nothing
  54. 'set my_conn = nothing
  55. 'set rs = nothing
  56. 'www.0416e.com/fc
  57. %>
  58. </body></html>