求代码修改,实现图片原文件名上传及保存
这是我当前的代码,按上传时间来命名的,想请高手们修改一下实现原文件名上传及保存<!--#include file="../inc/Const.asp"-->
<!--#include file="inc/cls_upfile.asp"-->
<%
'========最大上传的文件大小
Const MaxFileSize = 2048000
Const UP_FileTypes = "GIF|JPG|PNG|BMP|JPEG"
'==============================
'限制上传文件类型
'==============================
Function IsvalidFile(File_Type)
IsvalidFile = False
Dim GName, UP_FileType
UP_FileType = Split(UP_FileTypes, "|")
For Each GName in UP_FileType
If UCase(File_Type) = UCase(GName) Then
IsvalidFile = True
Exit For
End If
Next
End Function
%>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<script type="text/javascript">
window.isIE = (navigator.appName == "Microsoft Internet Explorer");
//插入上传附件
function addUploadItem(type,path){
var editType="<%=editType%>";
var html;
var oEditor = parent.FCKeditorAPI.GetInstance('content');
html = '<br /><img src="'+path+'"><br />';
oEditor.InsertHtml(html);
}
</script>
<style type="text/css">
<!--
body {
margin: 0px;
scrollbar-base-color: #F5FBFF;
scrollbar-arrow-color: #86B9D6;
font: 12px Verdana;
color: #333333;
}
td,input {
font: 12px Tahoma, Verdana;
}
-->
</style>
</head>
<body>
<%
Server.ScriptTimeOut = 999
If Request.Querystring("action") = "upload" Then
Dim upl, FSOIsOK
FSOIsOK = 1
If Err<>0 Then
Err.Clear
FSOIsOK = 0
End If
Dim savePath, saveName, FullPath
savePath = SiteRoot&"FlashHotel/thumb/"
Dim upload
Set upload = New Cls_Upfile
upload.GetData(MaxFileSize)
Dim ofile, F_Type, formName
For Each formName in upload.File '列出所有上传了的文件
Set ofile = upload.File(formName) '生成一个文件对象
Dim oFileSize
oFileSize = ofile.filesize
randomize
ranNum=int(900*rnd)+100
saveName = year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now) & ranNum & "." & LCase(ofile.fileExt)
FullPath = savePath & saveName
F_Type = ofile.fileExt
If oFileSize >(MaxFileSize) Then
Response.Write("<div style=""padding:6px""><a href=""attachment_Hx.asp"">文件大小" & oFileSize & "超出,请返回重新上传</a></div>")
--------------------编程问答-------------------- --------------------编程问答-------------------- saveName = year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now) & ranNum & "." & LCase(ofile.fileExt)
改成 saveName= ofile.FileName
补充:.NET技术 , ASP.NET