关于fso组件的权限问题!

sanyechonggyq 2004-08-05 12:28:39
我在用fso组件删除一个文件时出现权限问题!但是可以用fso在次文件夹创建.txt文件。
真是郁闷!不知道该如何解决,请大家帮助!

错误提示:
C:\Inetpub\wwwroot\myweb\c\upfile\product\v60i.gif
True
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft VBScript 运行时错误 错误 '800a0046'

没有权限

/c/admin_product_del.asp,行18



代码是:

<!-- #include file="const.asp"-->

<%
ifcookie()
dim hw_id,sql,sql2,fso,filepath
hw_id=request.QueryString("hw_id")
opendb()
set rs=server.createobject("adodb.recordset")
sql2="select * from product where id="&hw_id
rs.open sql2,conn,1,1
'response.Write rs("photoname")
if not rs("photoname")="" then
filepath=Server.MapPath("upfile/product/"&rs("photoname"))
set fso=server.CreateObject("scripting.fileSystemObject")
response.Write filepath&"<br>"
response.Write fso.fileExists(filepath)
fso.deletefile filepath
set fso=nothing
end if
rsclose()
'sql="delete from product where id="&hw_id
'response.end
'conn.execute(sql)


closedb()

%>
<meta http-equiv="refresh" content="2; url=<%=request.servervariables("HTTP_REFERER")%>">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>删除成功</title><p> </p>
<p> </p>
<p> </p>
<table width="62%" border="0" align="center">
<tr>
<td align="center"><p> <img src="images/loading.gif" width="94" height="27"><br>
<br>
<font size="2">删除成功,2秒钟后返回!</font></p>
</td>
</tr>
</table>
...全文
140 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
sanyechonggyq 2004-08-05
  • 打赏
  • 举报
回复
谢谢你呀!!
baby21st 2004-08-05
  • 打赏
  • 举报
回复
1、检查出错处的文件夹路径是否正确~~
2、如果所在盘分区为NTFS,OS为2003,检查文件夹的安全属性中是否有IIS的用户帐号(也就是说这个文件夹是由谁建立的,如果用ASP脚本创建的,则可以删除,如果不是,则会报错)
超级大笨狼 2004-08-05
  • 打赏
  • 举报
回复
服务器/文件夹/右键/安全/添加/iuser/设置权限

28,409

社区成员

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

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