R. Baris Taskiran
R. Baris Taskiran

Reputation: 31

Classic ASP FSO Permission Denied

I trying to get list of file via Classic ASP FSO companent.

But even I gave the root file permissions (IUSR_domain) from remote desktop, still I getting this error.

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
%>

Upvotes: 0

Views: 3672

Answers (2)

ScotterMonkey
ScotterMonkey

Reputation: 1054

set IUSR_machinename and IWAM_machinename to have change permissions for the folder.

Upvotes: 0

allski
allski

Reputation: 86

Try using Server.MapPath

for example:

    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.

Upvotes: 0

Related Questions