ASP的问题,-将日期转化成文件名-功能给去掉

来源:百度知道 编辑:UC知道 时间:2024/06/08 08:33:49
<!--#include file=conn.asp -->
<!--#include file=../include/config.asp -->
<!--#include file=chkuser.asp -->
<!--#include FILE="upload.inc"-->
<html>
<head>
<title>图片上传</title>

<script language="JavaScript">
<!-- Hide from older browsers...

//Function to add pic
function Addpic(imagePath){
window.opener.frames.message.focus();
window.opener.frames.message.document.execCommand('InsertImage', false, imagePath);
window.close();
}

// -->
</script>
</head>
<body>

<%
'上传方法,0=无组件,1=chinaaspupload
dim upload_type
upload_type=upload

dim upNum
dim uploadsuc
dim Forumupload
dim ranNum
dim uploadfiletype
dim upload,file,formName,formPath,iCount,filename,fileExt
upNum=session("upNum")
resp

如果只需要去掉文件名中的日期的话就把语句
filename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&fileExt
替换成:filename=ranNum&fileExt 就可以了,我不知道你是否还要其他功能。

有..这句话

ranNum=int(90000*rnd)+10000
filename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&fileExt

你只要把filename=你想要用的文件名就可以了..

randomize ranNum=int(90000*rnd) 10000 '生成随机数filename=year(now)