PicUpLoad.asp
上传用户:jiajie98
上传日期:2020-04-24
资源大小:1206k
文件大小:3k
- <!--#Include File="AdminCheck.asp"-->
- <!--#Include File="../Class/Cls_Upload.asp"--><%
- '==========================================
- '文 件 名:PicUpLoad.asp
- '文件用途:文件上传
- '系统开发:方卡在线
- '==========================================
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>上传图片</title>
- <style type="text/css">
- <!--
- body,td,th {
- font-size: 12px;
- }
- body {
- margin-left: 0px;
- margin-top: 0px;
- margin-right: 0px;
- margin-bottom: 0px;
- }
- a {
- font-size: 12px;
- color: #000;
- }
- a:link {
- text-decoration: none;
- }
- a:visited {
- text-decoration: none;
- color: #000;
- }
- a:hover {
- text-decoration: none;
- color: #333;
- }
- a:active {
- text-decoration: none;
- color: #000;
- }
- .Input,.Button {
- height:20px;
- line-height:20px;
- border:1px solid #999;
- border-bottom:1px solid #CCC;
- border-right:1px solid #CCC;
- }
- .Button {
- margin-left:0;
- }
- -->
- </style></head>
- <body>
- <%
- Call UpPic()
- '==============================
- '函 数 名:UpPic
- '作 用:上传图片
- '参 数:
- '==============================
- Sub UpPic()
- If Request.QueryString("Submit")="Pic" Then
- Dim UploadPath,UploadPath2,UploadSize,UploadType,UpRequest,AutoSave,Size,ShowSize,Str
- UploadPath="../Up/"
- UploadPath2="Up/"
- UploadSize="10240"
- UploadType="jpg/gif/png/bmp/rar/zip/doc/xls/ppt"
- Set UpRequest=New UpLoadClass
- UpRequest.SavePath=UploadPath
- UpRequest.MaxSize=UploadSize*1024
- UpRequest.FileType=UploadType
- AutoSave=true
- UpRequest.Open
- If UpRequest.Form("file_Err")<>0 Then
- Select Case UpRequest.Form("file_Err")
- 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>"
- Case 2:Str="<div style=""padding-top:5px;padding-bottom:5px;""> <font color=blue>上传不成功!文件格式不对 [<a href='javascript:history.go(-1)']>重新上传</a>]</font></div>"
- Case 3:Str="<div style=""padding-top:5px;padding-bottom:5px;""> <font color=blue>上传不成功!文件太大且格式不对 [<a href='javascript:history.go(-1)'>重新上传</a>]</font></div>"
- End Select
- Response.Write Str
- Else
- Response.Write "<script language=""javascript"">parent."&Request.QueryString("Form")&"."&Request.QueryString("Input")&".value='"&SiteDir&UploadPath2&UpRequest.Form("File")&"';"
- Response.Write "parent.PhotoShow.innerHTML='<img src="""&SiteDir&UploadPath2&UpRequest.Form("File")&""" width=""200"" height=""200"" />';"
- Response.Write "</script>"
- Size=UpRequest.Form("file_size")
- ShowSize=Size & " Byte"
- If Size>1024 Then
- Size=(Size1024)
- ShowSize=Size & " KB"
- End If
- If Size>1024 Then
- Size=(Size/1024)
- ShowSize=FormatNumber(Size,2) & " MB"
- End If
- Response.Write "<div style=""padding-top:5px;padding-bottom:5px;""> <font color=red>文件上传成功</font> [<a href='javascript:history.go(-1)'>重新上传</a>]</div>"
- End If
- Set UpRequest=nothing
- End If
- Response.Write "<Form name=Form action='?Submit=Pic&Form="&Request.QueryString("Form")&"&Input="&Request.QueryString("Input")&"' method=post enctype=multipart/Form-data>"
- Response.Write "<input type='file' name='file' class='Input' Size='20'> "
- Response.Write "<input type='submit' name='submit' value='上传' class=""Button"">"
- Response.Write "</Form>"
- End sub
- %>
- </body>
- </html>