发电厂锅炉维修税率:求网站上传源码?

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/04 09:59:19
我作了一个网站,要想建一个文件的上传区,不知道有没有源码,怎样做才能够实现网友的投稿?
急求?
可以讲 详细一点不
看不懂

<!--#include file="../common/conn.asp"-->
<!--#include file="upload.inc"-->
<%

'é?′?·?·¨£?0£??T×é?t£?1£?lyfupload£?2£?aspupload£?3£?chinaaspupload
dim arr(2)
dim upload_type
upload_type=0
dim upNum
dim uploadsuc
dim Forumupload
dim ranNum
dim uploadfiletype
dim upload,file,formName,formPath,iCount,filename,fileExt,fileccy

select case upload_type
case 0
call upload_0()
case 1
call upload_1()
case else
response.write "±??μí3?′?a·?2??t1|?ü"
response.end
end select

sub upload_0()
set upload=new upload_5xSoft ''?¨á¢é?′????ó

set image=upload.file("file")
formPath=upload.form("filepath")
xinghao=upload.form("xinghao")
intro=upload.form("intro")
classid=upload.form("classid")
atline=upload.form("atline")
doc1=upload.form("doc1")
doc2=upload.form("doc2")
doc3=upload.form("doc3")
doc4=upload.form("doc4")
doc5=upload.form("doc5")
link1=upload.form("link1")
link2=upload.form("link2")
link3=upload.form("link3")
link4=upload.form("link4")
link5=upload.form("link5")
title=upload.form("caption")
content=upload.form("content")

sql="select*from news"
rs.open sql,conn,3,2
rs.addnew
if image.filename<>"" then
''?ú????oó?ó(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"
iCount=0
j=0
for each formName in upload.file ''áD3??ùóDé?′?á?μ????t
set file=upload.file(formName) ''éú3éò??????t???ó

'if file.filesize>cint(uploadsize)*1000 then
'' response.write "<font size=2>???t′óD?3?1yá??T?? "&uploadsize&"K??[ <a href=# onclick=history.go(-1)>??D?é?′?</a> ]</font>"'
' response.end
'end if

fileExt=lcase(right(file.filename,4))
uploadsuc=false
Forumupload=split(Forum_upload,",")
for i=0 to ubound(Forumupload)
if fileEXT="."&trim(Forumupload(i)) then
uploadsuc=true
exit for
else
uploadsuc=false
end if
next
if fileEXT=".asp" and fileEXT=".asa" and fileEXT=".aspx" then
uploadsuc=false
end if
'if uploadsuc=false then
' response.write "<font size=2>???t??ê?2??yè·??[ <a href=# onclick=history.go(-1)>??D?é?′?</a> ]</font>"
'response.end
'end if

randomize
ranNum=int(90000*rnd)+10000
fileccy=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&fileExt
filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&fileExt

if file.FileSize>0 then ''è?1? FileSize > 0 ?μ?÷óD???têy?Y
file.SaveAs Server.mappath("../image/"&fileccy) ''±£′????t
'for i=0 to ubound(Forumupload)
' if fileEXT="."&trim(Forumupload(i)) then
' response.write "<script>parent.frmAnnounce.Content.value+='[upload="&Forumupload(i)&"]"&FileName&"[/upload]'</script>"
'exit for
'end if
' next
arr(j)=filename
j=j+1
iCount=iCount+1
end if
set file=nothing
next

rs("imgpath1")=arr(0)
if arr(1)<>"" then
rs("imgpath2")=arr(1)
end if
if arr(2)<>"" then
rs("imgpath3")=arr(2)
end if
end if
rs("caption")=title
rs("xinghao")=xinghao
rs("intro")=intro
rs("classid")=classid
rs("atline")=atline
rs("doc1")=doc1
rs("doc2")=doc2
rs("doc3")=doc3
rs("doc4")=doc4
rs("doc5")=doc5
rs("link1")=link1
rs("link2")=link2
rs("link3")=link3
rs("link4")=link4
rs("link5")=link5
rs("content")=content
rs.update
rs.close

set upload=nothing

'Htmend iCount&" ?????té?′??áê?!"
end sub

sub HtmEnd(Msg)
if upNum="" then upNum=1
session("upNum")=upNum+1
response.write "<font size=2>???té?′?3é1| [ <a href=# onclick=history.go(-1)>?ìD?é?′?</a> ]</font>"
response.end
end sub

'--------??è??ú×a?ˉ3é???t??--------
function MakedownName(filename)
dim fname,Forumupload,u
fname = year(now())&month(now())&day(now())&hour(now())&minuth(now())&secong(now())
Forumupload=split(Forum_upload,",")
for u=0 to ubound(Forumupload)
if instr(filename,Forumupload(u))>0 then
uploadfiletype=Forumupload(u)
MakedownName=fname & "." & Forumupload(u)
exit for
end if
next
end function

%>
<SCRIPT LANGUAGE="JavaScript">
<!--
alert('添加成功!');
window.navigate('addnews.asp');
//-->
</SCRIPT>