📄 upfile.asp
字号:
<!--#include FILE="upload_5xsoft.inc"-->
<html>
<head>
<title>文件上传</title>
</head>
<body>
<br>新闻图片 & 文件上传<hr size=1 noshadow width=300 align=left><br><br>
<%
dim upload,file,formName,formPath,iCount,fname
set upload=new upload_5xSoft ''建立上传对象
response.write upload.Version&"<br><br>" ''显示上传类的版本
if upload.form("filepath")="" then ''得到上传目录
HtmEnd "请输入要上传至的目录!"
set upload=nothing
response.end
else
formPath=upload.form("filepath")
''在目录后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"
end if
set file=upload.file("file1") ''生成一个文件对象
iCount=0
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,"下午","")
fname = day(date) & "-" & fname
path=fname
path=path&right(file.FileName,Len(file.FileName)-InStrRev(file.FileName,".")+1)
pathtemp="upfile/" & path
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
file.SaveAs Server.mappath(formPath&path) ''保存文件
response.write file.FilePath&file.FileName&" ("&file.FileSize&") => "&formPath&File.FileName&" 成功!<br>"
response.write Server.mappath(formPath&file.FileName)
dim fjlj
fjlj=file.FileName
iCount=iCount+1
end if
set file=nothing
set upload=nothing ''删除此对象
'Htmend iCount&" 个文件上传结束!"
'sub HtmEnd(Msg)
' set upload=nothing
' response.write "<br>"&Msg&" [<a href=""tj20.asp"">完成</a>]"
'response.end
'end sub
%>
<form name="form1" method="post" action="rssw_ryjbxx_add.asp">
<input type="hidden" name="zplj" value="<%=pathtemp%>">
</form>
<script language="javascript">
opener.form1.Accessories.value='<%=pathtemp%>';
window.close();
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -