razzzzer
asked on
permission denied involving CreateObject("Scripting.FileSystemObject")
code:
set fs = CreateObject("Scripting.Fi leSystemOb ject")
set folder = fs.GetFolder(path)
for each item in folder.SubFolders
ListFolderContents(item.Pa th)
next
This code has worked for about 6months or so on a windows 2003 server. Any recent updates (security related maybe) that have changed the way permissions work? I get a permission denied error on the for each item line.
iusr machine account has read and write perms.
thanks
set fs = CreateObject("Scripting.Fi
set folder = fs.GetFolder(path)
for each item in folder.SubFolders
ListFolderContents(item.Pa
next
This code has worked for about 6months or so on a windows 2003 server. Any recent updates (security related maybe) that have changed the way permissions work? I get a permission denied error on the for each item line.
iusr machine account has read and write perms.
thanks
ASKER
on folder thru the file system
you'll have to show us the rest of your code.
ASKER
set fs = CreateObject("Scripting.Fi leSystemOb ject")
set folder = fs.GetFolder(path)
for each item in folder.SubFolders
ListFolderContents(item.Pa th)
next
i get an error on the for each line... odd because this worked up until recently so i can only assume a windows update changed things or perhaps a change was made in the folder but i cannot see what that would have been....
set folder = fs.GetFolder(path)
for each item in folder.SubFolders
ListFolderContents(item.Pa
next
i get an error on the for each line... odd because this worked up until recently so i can only assume a windows update changed things or perhaps a change was made in the folder but i cannot see what that would have been....
the whole code please. Also, the error that comes up would help ;-)
ASKER
well its a sub like so:
<% sub ListFolderContents(path)
dim fs, folder, file, item, url
set fs = CreateObject("Scripting.Fi leSystemOb ject")
set folder = fs.GetFolder(path)
for each item in folder.SubFolders
ListFolderContents(item.Pa th)
next
'Display a list of files.
theimage = galleryroot & (rsGalleryDetail.Fields.It em("fldGal leryID").V alue) & "/" & (rsGalleryDetail.Fields.It em("fldGal leryPic"). Value)
for each item in folder.Files
url = MapURL(item.path)
if url <> theimage then
%>
the error:
Microsoft VBScript runtime error '800a0046'
Permission denied
/template_gallery_detail.a sp, line 219
line 219 is the for loop
<% sub ListFolderContents(path)
dim fs, folder, file, item, url
set fs = CreateObject("Scripting.Fi
set folder = fs.GetFolder(path)
for each item in folder.SubFolders
ListFolderContents(item.Pa
next
'Display a list of files.
theimage = galleryroot & (rsGalleryDetail.Fields.It
for each item in folder.Files
url = MapURL(item.path)
if url <> theimage then
%>
the error:
Microsoft VBScript runtime error '800a0046'
Permission denied
/template_gallery_detail.a
line 219 is the for loop
ASKER
to be more precise line 219 is
for each item in folder.SubFolders
not sure because there is so much code and functions .. hope this is enough.. it just seems to me that the permissions are not correct on the folder that this code works on but .. the iusr accounts seems fine...
for each item in folder.SubFolders
not sure because there is so much code and functions .. hope this is enough.. it just seems to me that the permissions are not correct on the folder that this code works on but .. the iusr accounts seems fine...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
adding a response.write(path) right before the for loop returns a correct path
IUSR_machine has full control on the WHOLE web folder currently
IUSR_machine has full control on the WHOLE web folder currently
ASKER
well even tho the check boxes were set for full permissions i went ahead and clicked on advanced permissions and check the second box "replace permission entries on all child objects with entries shown here that apply to child objects" and clicked apply and things seem to work now... i just hope i didnt open things up (made a security risk). Big difference between a programmer and server admin ;)
honestly..if this is an upload/download directory it should be the only one to have such permissions, and even then to prevent leeching, you may want to consider moving to be in the same level as the webroot and coming up with a ado.stream script to stream the files to the browser
i do it at http://www.portalfanatic.com/gallery/?pCat=27
even the thumbnails are stored at the same level as the webroot folder and are streamed to the page via a binary write.
just food for thought :-)
glad I could help!
i do it at http://www.portalfanatic.com/gallery/?pCat=27
even the thumbnails are stored at the same level as the webroot folder and are streamed to the page via a binary write.
just food for thought :-)
glad I could help!
on the folder? or in IIS?
i ask only because I never got IIS only permissions to work, I always had to make sure the folder permissions were set as well....