关于fso组件的权限问题!
我在用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>