asp连接数据库代码实例(10)
发布时间:2021-06-06
发布时间:2021-06-06
asp 连接数据库代码实例
end if
vfname = filename(now())
fname = vfname & "." & GetExtendName(file.FileName)
file.SaveAs Server.mappath(formPath&fname) ''保存文件
%>
<script>
parent.form.picurl.value+='upfile/softpic/<%=fname%>' //-上传路径
//parent.frmadd.dreamcontent.value+='[img]upload/<%=ufp%>[/img]'
location.replace('Upsoftpic.asp') //---返回文件
</script>
<%
'------文件名
end if
set file=nothing
set upload=nothing
function filename(fname)
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
filename=fname
end function
function GetExtendName(FileName)
dim ExtName
ExtName = LCase(FileName)
ExtName = right(ExtName,3)
ExtName = right(ExtName,3-Instr(ExtName,"."))
GetExtendName = ExtName
end function
end if
%>
<!-- 上传软件或者图片结束 -->
upload.asp
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
dim Data_5xsoft
Class upload_5xsoft
dim objForm,objFile,Version