⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uploads.asp

📁 漂亮的企业网站系统v11 1、整体修改了上一版的一些BUG。 2、修改了页面底部的统计形式。 3、修改了“公告更新”栏目
💻 ASP
字号:
<!-- #INCLUDE FILE="include/config.asp" -->
<!--#include file="include/upload_config.asp"-->
<html>
<head>
<title><%response.write web_var(web_config,1)%> - 文件上传</title>
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<link rel=stylesheet href='images/joekoe.css' type=text/css>
<script langiage='javascript' src='style/mouse_on_title.js'></script>
</head>
<body topmargin=0 leftmargin=0 bgcolor=<%response.write web_var(web_color,1)%>>
<table border=0 height='100%'cellspacing=0 cellpadding=0><tr><td height='100%'>
<%
dim formname,upload_path,upload_type,upload_size
action=trim(request.querystring("action"))
if var_null(login_username)="" or var_null(login_password)="" then
  response.write " "&web_var(web_error,2)
else
  upload_path=web_var(web_upload,1)
  upload_type=web_var(web_upload,5)
  upload_size=web_var(web_upload,3)
  select case action
  case "upfile"
    call upload_chk()
  case else
    call upload_main()
  end select
end if

sub upload_chk()
  Server.ScriptTimeOut=5000
  dim upload,up_text,up_path,uptemp,uppath,up_name,MyFso,upfile,upcount,upfilename,upfile_name,upfile_name2,upfilesize
  set upload=new upload_classes
  set MyFso=CreateObject("Scripting.FileSystemObject")
  upcount=1
  up_name=trim(upload.form("up_name"))
  up_text=trim(upload.form("up_text"))
  up_path=trim(upload.form("up_path"))
  if len(up_path)<3 then up_path="other"
  uppath=up_path
  if right(upload_path,1)<>"/" then upload_path=upload_path&"/"
  up_path=server.mappath(upload_path&up_path)
  if not MyFso.folderExists(up_path) then
    set up_path=MyFso.CreateFolder(up_path)
  end if
  if right(up_path,1)<>"/" then up_path=up_path&"/"
  'if right(uppath,1)<>"/" then uppath=uppath&"/"

  set upfile=upload.file("file_name1")
  upfilesize=upfile.FileSize
  upload_size=upload_size*1024
  if upfilesize>0 then
    upfilename=upfile.FileName
    if upfilesize>upload_size then
      uptemp="<font class=red_2>上传失败</font>:文件太大!(不能超过"&int(upload_size/1024)&"KB) "&go_back
    else
      upfile_name=Right(upfilename,(len(upfilename)-Instr(upfilename,".")))
      upfile_name=lcase(upfile_name)
      if instr(","&upload_type&",",","&upfile_name&",")>0 then
        upfile_name2=upfile_name
        upfile_name=up_name&"."&upfile_name
        upfile.SaveAs up_path&upfile_name
        uptemp="<font class=red>恭喜你,你的头像上传成功,请设置头像高度和宽度再更新资料!</font>"
        if instr(up_text,"pic")>0 then
          uptemp=uptemp&"<script>parent.document.all."&up_text&".value='"&uppath&"/"&upfile_name&"'</script>"
        else
          uptemp=uptemp&"&nbsp;&nbsp;<script>parent.document.all."&up_text&".value+='"
          select case lcase(upfile_name2)
          case "gif","jpg"
            uptemp=uptemp&upload_path&uppath&"/"&upfile_name
          end select
          uptemp=uptemp&"\n'</script>"
        end if
      else
        uptemp="<font class=red_2>上传失败</font>:文件类型只能为:"&replace(upload_type,"|","、")&"等格式)"&go_back
      end if
    end if
  else
    uptemp="<font class=red_2>上传失败</font>:您可能没有选择想要上传的头像!"&go_back
  end if
  set upfile=nothing
  response.write uptemp
  set MyFso=nothing
  set upload=nothing
end sub

sub upload_main()
  dim uppath,upname,uptext
  uppath=trim(request.querystring("uppath"))
  upname=trim(request.querystring("upname"))
  uptext=trim(request.querystring("uptext"))
  if len(uppath)<1 or len(uptext)<1 then
    response.write "参数出错!"
    response.end
  end if
  if len(upname)<3 then
    upname=upname&upload_time(now())
  end if
%>
<table border=0 cellspacing=0 cellpadding=2>
<form name=form1 action='?action=upfile' method=post enctype='multipart/form-data'>
<input type=hidden name=up_path value='<%response.write uppath%>'>
<input type=hidden name=up_name value='<% response.write upname %>'>
<input type=hidden name=up_text value='<% response.write uptext %>'>
<tr>
<td><input type=file name=file_name1 value='' size=27></td>
<td align=center height=30><input type=submit name=submit value='点击上传'> (<=<% response.write upload_size %>KB)</td>
</tr>
</form>
</table>
<% end sub %>
</td></tr></table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -