一聚教程网:一个值得你收藏的教程网站

热门教程

asp 无组件文件上传代码

时间:2022-07-02 23:11:55 编辑:袖梨 来源:一聚教程网




文件上传

css" type="text/css">


<%

fuptype=session("fuptype")'上传类型
fupname=session("fupname")'文件名
frmname=session("frmname")'form名
bdname=session("bdname")  '表单名
if fuptype="" or fupname="" or frmname="" then
response.write ""
response.end
end if
%>

<%
set upload=new upload_5xsoft
set file=upload.file("file1")
if file.fileSize>0 then
filename=fupname+"."
filenameend=file.filename
filenameend=split(filenameend,".")
n=UBound(filenameend)
filename=filename&filenameend(n)
if fuptype<>"db" then
if file.fileSize>1572864 then
response.write ""
response.end
end if
end if
if fuptype="adv" or fuptype="pic" then
if LCase(filenameend(n))<>"gif" and LCase(filenameend(n))<>"jpg" and LCase(filenameend(n))<>"doc" and LCase(filenameend(n))<>"xls" and LCase(filenameend(n))<>"rar" and LCase(filenameend(n))<>"zip" and LCase(filenameend(n))<>"txt" then
response.write ""
response.end
end if
end if
if fuptype="pic" then
savepath="../pic_1/"&filename
end If

file.saveAs Server.mappath(savepath)
'response.write "文件上传成功!上传文件的物理路径为:"
'response.write ""&Server.mappath(savepath)&"

"
'response.write "点击预览上传的文件"
'response.write "

"
response.write ""

%>
<%
else
response.write ""
response.end
end if
set upload=nothing
session("fuptype")=""
session("fupname")=""
session("frmname")=""
%>

下面是upload_5xsoft.inc文件直接下载保存这段代码

热门栏目