html5无组件上传,真正的无组件上传,而且也不用数据库(转载)

upload.htm

———————————-

untitled document

td {  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

%>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值