| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 539 人关注过本帖
标题:求助高手!!!
只看楼主 加入收藏
lizhe123
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-11-3
收藏
 问题点数:0 回复次数:1 
求助高手!!!

各位大哥,大姐们,小弟我做了个网站,就是图片不能上传,在本地测试成功,但是上传到远端就无法实现了,我知道可能是服务器环境改变了,但是不知道如何修改,求大哥,大姐们指点指点!!
提示错误:
Server.MapPath() error 'ASP 0171 : 80004005'
Missing Path

/dianzishangwu/xrclass23/upload.asp, line 26

The Path parameter must be specified for the MapPath method.

以下是代码:
<%Server.ScriptTimeout=180%>
<!--#include FILE="upinc.inc"-->
<html>
<head>
<title>文件上传</title>
<style type="text/css">
.p9{ font-size: 9pt; font-family: 宋体 }
.tx1 { width: 400 ;height: 20px; font-size: 9pt; border: 0px solid; border-color: black #000000; color: #0000FF}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin="20" topmargin="20" class="p9">
<table align="center" border="1" cellpadding="6" cellspacing="0" bordercolor="#000000" class="p9" style="border-collapse: collapse">
<tr bgcolor="#CCCCCC">
<td align="center" height="25" valign='middle'>本地文件</td>
<td align="center" valign='middle'>大小(字节)</td>
<td align="center" valign='middle'>上传文件名</td>
<td align="center" valign='middle'>状态</td>
</tr>
<%
dim upfile,formPath,ServerPath,FSPath,filePath,formName,FileName,oFile,upfilecount
upfilecount=0
set upfile=new clsUp ''建立上传对象
upfile.NoAllowExt="asp;exe;htm;html;aspx;cs;vb;js;" '设置上传类型的黑名单
upfile.GetData (10240000) '取得上传数据,限制最大上传10M
filePath=Server.mappath(upfile.form("filePath"))&"\" 就是这行出错!!
ServerPath=GetFilePath(Request.ServerVariables("HTTP_REFERER"),"/")'取得在网站上的位置
for each formName in upfile.file '列出所有上传了的文件
set oFile=upfile.file(formname)
if oFile.FileSize=0 then
response.write"<SCRIPT language=JavaScript>alert('您没有上传文件呀!!!!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
if oFile.FileSize>0 then
if oFile.FileSize>5240000 then '限制最大上传5M
response.write"<SCRIPT language=JavaScript>alert('您上传的文件大于规定大小(5M),请改变文件大小后再进行上传。');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
end if
FileName=upfile.form(formName)'取得文本域的值
if not FileName>"" then FileName=oFile.filename else FileName=FileName&"."&oFile.FileExt
if upfile.form("fjr")=1 then
imgs=upfile.AutoSave (formname,filePath&FileName)
else
imgs=upfile.SaveToFile (formname,filePath&FileName)
end if
if upfile.iserr then
response.write"<SCRIPT language=JavaScript>alert('"&upfile.errmessage&"');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
%>
<tr>
<td align="center" height="20"><%=oFile.FilePath&oFile.FileName%></td>
<td align="center"><%=oFile.filesize%></td>
<td align="center"><input type=text size=40 name=upfile1 value=<%=upfile.form("filePath")&"/"&imgs%>></td>
<td align="center">
<%
if upfile.iserr then
Response.Write upfile.errmessage
else
upfilecount=upfilecount+1
Response.Write "上传成功"
end if
%></td>
</tr>
<%
set oFile=nothing
next
%>
<tr>
<td align="center" colspan="4" height="25" valign='middle'>一共上传了<%=upfileCount%>个文件,请复制上面的文件名和路径到相应的输入框,谢谢合作!! [<a href="upfile.asp">返回</a>]</td>
</tr>
<%
set upfile=nothing '删除此对象
%>
</table>
</body>
</html>
<%
function GetFilePath(FullPath,str)
If FullPath <> "" Then
GetFilePath = left(FullPath,InStrRev(FullPath, str))
Else
GetFilePath = ""
End If
End function
%>

请各位大虾指点一下!!

搜索更多相关主题的帖子: 服务器 html specified include method 
2005-11-03 09:57
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
filePath
有这个文件夹吗?

找不到包含文件


如果没有
你需要创建一个

2005-11-03 10:00
快速回复:求助高手!!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014279 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved