ASP上传后显示文件地址

来源:百度知道 编辑:UC知道 时间:2024/05/24 12:39:48
<%OPTION EXPLICIT%>
<%Server.ScriptTimeOut=5000%>
<!--#include FILE="upload_5xsoft.inc"-->
<%
dim upload,file,formName,formPath
set upload=new upload_5xsoft ''建立上传对象

formPath="file/"'路径

for each formName in upload.objFile ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
file.SaveAs Server.mappath(formPath&file.FileName) ''保存文件
end if
set file=nothing
next

set upload=nothing ''删除此对象
%>
<!-- 在这里让它显示出上传后的文件地址 -->

<%
dim upload,file,formName,formPath
set upload=new upload_5xsoft ''建立上传对象

formPath="file/"'路径

for each formName in upload.objFile ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
size1="1" '表示有文件,在下文判断
file.SaveAs Server.mappath(formPath&file.FileName) ''保存文件
name=file.FileName '记录名字
end if
set file=nothing
next

set upload=nothing ''删除此对象
%>接下去写
<%if size1="1" then%>
你所上传的地址为: file/<%=name%>
<%else%>
没有文件上传
<%end if%>

filepath = formPath & fileName

<%
dim upload,file,formName,formPath
set upload=new upload_5xsoft ''建立上传对象

formPath="file/"'路径

for each formName in upload.objFile ''列出所有上传了的文件
s