我试图通过经典ASP FSO公司获得文件列表。
但是,即使我从远程桌面授予根文件权限(IUSR_domain),我仍然会得到这个错误。
Microsoft VBScript runtime error '800a0046'
Permission denied
/default2.asp, line 28<%
fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("C:\inetpub\vhosts\xx.com\httpdocs\photo\other") <-- line 28
for each x in fo.files
%>
<div id="photos">
<div class="photo"><%Response.write(x.Name & "<br>")%></div>
</div>
<%next
set fo=nothing
set fs=nothing
%>发布于 2014-06-06 21:21:26
尝试使用Server.MapPath
例如:
downloadFileDirectory = Server.MapPath("\httpdocs\photo\other")
Set fs= CreateObject("Scripting.FileSystemObject")
If fs.FolderExists(downloadFileDirectory) Then
Set fo= fs.GetFolder(downloadFileDirectory)
for each x in fo.files
%>etc.发布于 2014-06-10 04:30:19
将IUSR_machinename和IWAM_machinename设置为对文件夹具有更改权限。
https://stackoverflow.com/questions/24075453
复制相似问题