0

我试图通过经典 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
%>
4

2 回答 2

0

尝试使用 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-06T21:21:26.717 回答
0

将 IUSR_machinename 和 IWAM_machinename 设置为对文件夹具有更改权限。

于 2014-06-10T04:30:19.287 回答