我试图通过Classic ASP FSO companent获取文件列表。
但即使我从远程桌面提供了根文件权限(IUSR域),我仍然收到此错误。
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
%>
答案 0 :(得分: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.
答案 1 :(得分:0)
设置IUSR_machinename和IWAM_machinename以拥有该文件夹的更改权限。