upload.htm
———————————-
untitled documenttd { font-size: 9pt}
a { color: #000000; text-decoration: none}
a:hover { text-decoration: underline}
.tx { height: 16px; width: 30px; border-color: black black #000000; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; font-size: 9pt; background-color: #eeeeee; color: #0000ff}
.bt { font-size: 9pt; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; height: 16px; width: 80px; background-color: #eeeeee; cursor: hand}
.tx1 { height: 20px; width: 30px; font-size: 9pt; border: 1px solid; border-color: black black #000000; color: #0000ff}
–>
文件上传 |
化境编程界文件上传 |
function setid() { str= if(!window.form1.upcount.value) window.form1.upcount.value=1; for(i=1;i<=window.form1.upcount.value;i++) str+=文件+i+: window.upid.innerhtml=str+ } 需要上传的个数上传到: |
文件1: |
setid();
————————————-
upfile.asp
文件上传
化境文件上传!
dim upload,file,formname,formpath,icount
set upload=new upload_5xsoft 建立上传对象
response.write upload.version&"
" 显示上传类的版本
if upload.form("filepath")="" then 得到上传目录
htmend "请输入要上传至的目录!"
set upload=nothing
response.end
else
formpath=upload.form("filepath")
在目录后加(/)
if right(formpath,1)<>"/" then formpath=formpath&"/"
end if
icount=0
for each formname in upload.file 列出所有上传了的文件
set file=upload.file(formname) 生成一个文件对象
if file.filesize>0 then 如果 filesize > 0 说明有文件数据
file.saveas server.mappath(formpath&file.filename) 保存文件
response.write file.filepath&file.filename&" ("&file.filesize&") => "&formpath&file.filename&" 成功!
"
icount=icount+1
end if
set file=nothing
next
set upload=nothing 删除此对象
htmend icount&" 个文件上传结束!"
sub htmend(msg)
set upload=nothing
response.write "
"&msg&" [返回]"
response.end
end sub
%>