asp上传功能,本地测试正确,远程找不到路径。

renze 2011-02-12 11:41:55
值:E:\pro\IDa.jpg值2:e:\www\web\User\PicIDCard\2010325112325.jpg
Microsoft VBScript 运行时错误 错误 '800a004c'

路径未找到


我已经将路径输出,路径是没有问题的。但不知道是什么原因,附源代码,功能是将本地文件覆盖远程的指定文件。
’------------------------------------------------------------------------------------------

<%
Dim Rs4,bigIDCard,smallIDCard
Set Rs4=server.createobject("adodb.recordset")
Rs4.open "select * from UserFile where dlID='"&UserName&"'",conn,1,3
if Not Rs4.eof then
bigIDCard=Rs4("PicIDCard")
smallIDCard=Rs4("PicIDCard2")
End if


'-------------------------------------------------------------------------

'#处理上传文件
if Request.QueryString("action")="save" then

stoppath="./PicIDCard/"&bigIDCard '#服务器上的地址'
startpath=Request.Form("picname") '#要复制的源文件路径'
Call copy_(startpath,stoppath)

Rs4("Flag")=0
Rs4.upDate
Rs4.close
Response.end

%> <%Else%>
<form id="form1" name="form1" method="post" action="?action=save">

<div>
<input type="hidden" name="picname"/>
<input type="file" name="foo" id="foo" size="60" />
<input type="button" value="Show Value" onclick="alert(document.getElementById('foo').value)" />
<input type="button" value="Show Value in FF3" onclick="alert(getValueFF('foo'))" />
<input type="button" value="Show Value in IE8" onclick="alert(getValueIE8('foo'))" />
</div>
<input type="submit" name="Submit" value="提交" onclick="alert(getValueIE8('foo'))"/>
</form>
<div id="show"></div>
<script language="JavaScript">
function getValueFF(id){
var ip = document.getElementById(id);
if (ip.files) {
//ffx3 - try to have access to full path
try {
netscape.security.PrivilegeManager.enablePrivilege( 'UniversalFileRead' )
}
catch (err) {
//need to set signed.applets.codebase_principal_support to true
}
};
return ip.value;
}


function getValueIE8(id){

var ip = document.getElementById(id);
ip.select();
//return document.selection.createRange().text;
var img=document.createElement("img");

input=top.document.getElementsByName("picname");
input[0].value=document.selection.createRange().text;

return img.src = document.selection.createRange().text;
}

</script>
</body>

</body>
<%end if%><%
'--------------------------------------------------------------------------
function copy_(startpath,stoppath)

startpath=startpath
response.write "值:"&startpath


'startpath=Server.MapPath(startpath) '客户端上

stoppath=Server.MapPath(stoppath) '服务器上绝对路径




response.write "值2:"&stoppath
'--------------------------------------------
set fso=Server.CreateObject("Scripting.FileSystemObject")
'----------------------------------------------

if fso.FileExists(stoppath) then '#如原文件存在
fso.DeleteFile(stoppath),true '#删除原文件
fso.CopyFile startpath,stoppath,true'#上传新文件

else '#若文件不存在

fso.CopyFile startpath,stoppath,true '#直接上传文件
end if

'Response.Write("已成功将 "& startpath &" 复制到 "& stoppath)
Response.write ("更改成功!")
set fso=nothing
End function

%>
...全文
56 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
renze 2011-02-13
  • 打赏
  • 举报
回复
用无组件可以正常上传,我也想应该是权限的问题,谢谢各位了,我再想办法改一下程序。
Dogfish 2011-02-13
  • 打赏
  • 举报
回复
确定路径是否正确
确定是否有写的权限和访问的权限。
renze 2011-02-13
  • 打赏
  • 举报
回复
这个没有办法测试,因为空间是租用的。
hookee 2011-02-12
  • 打赏
  • 举报
回复
路径的目录 有IUser_xxx用户写的权限吗?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧