关于上传图片名称的问题 我现在用的是随机日期加图片名称 怎么改成随机日期的
<%function makefilename()
dim fname
fname = now()
fname = trim(fname)
fname = replace(fname,"-","")
fname = replace(fname,"/","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
makefilename=fname
end function
%>
<%
'set tt=new upload_5xsoft
'set file=tt.file("file1")
'set file2=tt.file("file2")
set tt=new upload_5xsoft
set file1=tt.file("file1")
'if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
'file.SaveAs Server.mappath(bPath&file.FileName) ''保存文件
'end if
'set file=nothing
%>
<%
file1.saveAs Server.mappath("../cp/"&makefilename+file1.filename) // 关键是这里 我把+file1.filename 去掉后 上传上去的图片是随机数字但是没有图片后缀啦 就是没有.jpg 或者.gif 或者.png 没有类型啦 只是一个数字 没法打开
response.Write makefilename+file1.filename
%>
<input name="dtp" type="hidden" value="<%=makefilename+file1.filename%>" id="dtp"/>
<script>parent.document.form1.dtp.value=document.getElementById("dtp").value;</script>