I have a Classic ASP website which we have moved from IIS 6 to Win2k8 and IIS 7. Within the website folder structure, is a Virtual Directory called Products containing JPGs that are physically stored elsewhere on the same server.
Within a web browser, any of the Product JPGs display correctly on the page. E.g. http://www.MySite.com/images/poducts/widget.jpg works a treat.
However, this folder is unavailable when trying to access it in ASP code, using the FileSystemObject - all other files/folders are there except the Virtual Directory. Here is an example ASP code snippet:
Set objFSO = Server.CreateObject( "Scripting.FileSystemObject" )
Set objBaseFolder = objFSO.GetFolder( Server.Mappath( "../../Images" ) )
For Each objFolder In objBaseFolder.SubFolders
Response.Write( objFolder.Name & "<br>" )
Next
Set objFolder = Nothing
Set objBaseFolder = Nothing
Set objFSO = Nothing
Additionally, Persit's ASPJpeg Com Object has no problem opening and saving JPG files to/from this Virtual Directory from ASP code.
In IIS7, the website has an Application Pool, and I've tried all manner settings for its identity to no avail. I have also tried applying various security settings (IUSR_, Network Service, et al) to the physical folder that the Virtual Directory points to - even granting full control to "Everyone" at one point.
It really seems like the ASP process does not have permission to Virtual Directories. If anyone has and idea on how to solve this problem then I'd be most greatful.
I vaguely remember having a problem like that and the culprit was
Server.Mappath
. To solve it I needed to map to a file inside the folder and then remove the file part