Directions for IIS 6
You need to change the 'Home Directory' permissions with IIS Manager.
Open Properties on the website. Select the 'Home Directory' tab. Check the 'Write' checkbox to enable write permissions.
If you are set on doing this, I would suggest only enabling write on a particular directory and not the entire website. Changing the permissions for a single directory is the same as above except instead of selecting Properties for the entire website, choose Properties for the directory where you will be creating files.
Directions for IIS 7
- Open Internet Information Systems (IIS) Manager
- Expand the site you want to modify (hit the plus next to the name)
- Right-click the directory where you would like to be able to write files and select
Edit Permissions
- Click on the
Security
tab
- Click on
Edit...
under the group and users list
- Select
IIS_IUSRS
from the "Groups or user names" list and add make sure the Allow
checkbox is marked for Write
.
I know this sounds a lot like what you did in 1) of your question but I'm guessing you may just edited the permissions through Windows Explorer rather than IIS Manager. Let me know what error(s) you see if the steps above still don't work for you.
I tested writing a file to disk using an example from aspalliance.com and it worked great when I granted IIS_IUSRS
write permission to the output directory and stopped working when I removed the write permission.