views:

3459

answers:

1

Hi,

We've just moved our website to win2008 and IIS7 from win2000 with IS5 and I have some problems.

I have a folder that in it is an ASP page that upload a file to an upper folder, in the old IIS, I gave to the folder with the ASP page the permissions of the administrator and it's work fine, the files could be uploaded to an upper folders. BUT in the IIS7 I can't do it, I give to the folder with the asp code all the writing permission and it's not working. It's only work if I give a writing permissions to the upper targert folders. I don't wont to give to the target folders a full permission because those are the main web site folders.

So how can I do it? How can I give a folder a permission to write also to an upper folder that doesn's have this permmision?

Thanks

+4  A: 

One possible reason is that you are attempting to access the parent with a MapPath and this is failing because Parent Paths haven't been enabled.

Since IIS6 the ability for code to access parent folders is by default blocked. To do this it is necessary to enable parent paths. In IIS7 parent paths can be enabled at Server, Site, Application or Folder level. In IIS manager click on the site, application or folder you want to enable this for, double click the ASP icon, in the Behavour section set 'Enable Parent Paths' to True.

AnthonyWJones
Anthony - thanks for this. I've been banging my head against the desk for a while over saving files from ASP on Windows 2008 and this has just fixed my problem. Excellent answer.
Simon Forrest
Turns out I spoke too soon - this wasn't the fix after all, it just happened to work on the page I was testing. I finally fixed it by registering the upload component as a COM+ Application through Component Services and giving it appropriate permissions to write to the directories concerned.
Simon Forrest