永发信息网

asp无组件上传图片完整代码?

答案:3  悬赏:60  手机版
解决时间 2021-04-16 08:17

要完整一点的,能运行

最佳答案

加我Q,我能给你完整无组建上传代码,


答案:flower

全部回答

http://wenwen.sogou.com/z/q905645641.htm

希望能帮到你

<% '上传方法,0=无组件,1=chinaaspupload dim upload_type upload_type=upload dim uploadsuc dim Forumupload dim ranNum dim uploadfiletype dim upload,file,formName,formPath,iCount,filename,fileExt response.write "<body leftmargin=0 topmargin=0>" select case upload_type case 0 call upload_0() case 1 call upload_1() case else response.write "本系统未开放插件功能" response.end end select sub upload_0() set upload=new upload_5xSoft ''建立上传对象 formPath=upload.form("filepath") ''在目录后加(/) if right(formPath,1)<>"/" then formPath=formPath&"/" response.write "<body leftmargin=5 topmargin=3>" for each formName in upload.file ''列出所有上传了的文件 set file=upload.file(formName) ''生成一个文件对象 if file.filesize<100 then response.write "<span font-family: 宋体; font-size: 9pt"">请先选择你要上传的图片 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>" response.end end if if file.filesize>1024000 then response.write "<span font-family: 宋体; font-size: 9pt"">图片大小超过了限制 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>" response.end end if fileExt=lcase(getFileExtName(file.fileName)) if fileext<>"jpg" and fileext<>"png" and fileext<>"gif" and fileext<>"bmp" then response.write "<span font-family: 宋体; font-size: 9pt"">该文件格式不允许上传 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>" response.end end if randomize rannum=int(90000*rnd)+10000 filename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&rannum&"."&fileExt %> <% if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据 file.SaveAs Server.mappath(formPath &filename) ''保存文件 response.write "<script>parent.document.FrmAddLink.photo.value='uploadfile/face/"&FileName&"'</script>" end if set file=nothing next set upload=nothing Htmend iCount&" 个文件上传结束!" end sub sub HtmEnd(Msg) response.write "<span font-family: 宋体; font-size: 9pt"">图片上传成功 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>" response.end end sub sub upload_1() set FileUp=server.createobject("ChinaASP.UpLoad") ''建立上传对象 filepath=server.MapPath("../uploadfile/face/") response.write "<body leftmargin=5 topmargin=3>" for each f in fileup.Files ''列出所有上传了的文件 if f.filesize<100 then response.write "<span font-family: 宋体; font-size: 9pt"">请先选择你要上传的图片 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>" response.end end if if f.filesize>1024000 then response.write "<span font-family: 宋体; font-size: 9pt"">图片大小超过了限制 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>" response.end end if fileExt=lcase(getFileExtName(f.fileName)) if fileext<>"jpg" and fileext<>"png" and fileext<>"gif" and fileext<>"bmp" then response.write "<span font-family: 宋体; font-size: 9pt"">该文件格式不允许上传 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>" response.end end if randomize rannum=int(90000*rnd)+10000 filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&rannum&"."&fileExt %> <% if f.FileSize>0 then ''如果 FileSize > 0 说明有文件数据 f.saveas filePath & "\"&filename ''保存文件 response.write "<script>parent.document.FrmAddLink.photo.value='uploadfile/face/"&FileName&"'</script>" end if set f=nothing next set FileUp=nothing Htmend iCount&" 个文件上传结束!" end sub sub HtmEnd(Msg) response.write "<span font-family: 宋体; font-size: 9pt"">图片上传成功 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>" response.end end sub %>
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
为什么人在镜子上会漂亮?
QQ到3个太阳值多少钱?VIP6
高考报考填写志愿应该注意些什么问题呢?
城中路/城南北二巷(路口)在什么地方啊,我要
寻仙怎么点?
肾积水 急救
别人给了好多牛肉干,但是不怎么干,自己咋能
以自强不息,厚德载物为题作文1500字
CPU2.80 内存512 主板带256的显卡 玩3D游戏画
以前画菩萨的颜料是哪种颜料?
安踏有几个分公司啊
表示天气变化的句子,有关于描写天气变化多端
召陵镇李村卫生室地址在什么地方,想过去办事
我打牌获得宝箱在哪??
临时调动通知单该怎么写
推荐资讯
qq英雄岛网通2五服有制造厉害的吗
我是牧场11级,今天下午我没在,回来后发现牧
温室花卉技术员一个月多少钱,在北方
区园林场在哪里啊,我有事要去这个地方
小伟果蔬店这个地址在什么地方,我要处理点事
人为什么会死呀
有没有一种法术可以看透一个人的心灵
如果Q宠,长期不能得以照顾,该怎么办
菜鸟驿站(西半壁店村停车场正对面天天快递)怎
富士j25和j35哪台好?
谁会玩风云?
高淳区湖滨高级中学在什么地方啊,我要过去处
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?