| 发表于:2007-10-12 16:40:52 楼主 |
<% formpath=upload.form("filepath") icount=0 for each formname in upload.objfile ''列出所有上传了的文件 set file=upload.file(formname) ''生成一个文件对象 if file.filesize> 0 then ''如果 filesize > 0 说明有文件数据 fname=year(now)&right("0"&month(now),2)&right("0"&day(now),2)&right("0"&hour(now),2)&right("0"&minute(now),2)&right("0"&second(now),2) exname=right(file.filename,len(file.filename)-instr(file.filename,".")+1) file.filename=fname&icount&exname file.saveas server.mappath(formpath&file.filename) ''保存文件 icount=icount+1 set rs=server.createobject("adodb.recordset") sql1="update coimages set imagename='"&formpath&file.filename&"' where productid='"&productid&"'" rs.open sql1,conn,1,3 end if set file=nothing next %> 小弟新手,希望大家能帮我解释下代码好么?我就是想做一个图片修改系统.希望高手们帮忙啊! |
|
|
|
|