Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have to create an excel file and save in to one folder in my system.But when i try this am getting error that 'Access is denied' but i have all access to that folder. Am administrator of the system.
Can any developers help me please ?
Posted
Comments
[no name] 16-Oct-14 9:24am    
What is the path you are trying to access? If the path is outside of the directory of which IIS operates, obviously it won't have permissions to edit, add remove or execute anything. Nor should it! You can add custom folders to IIS providing permissions to those directories by elevating the IIS user level for that directory.

You may be the administrator, but your IIS_ASP process most probably isn't (and shouldn't ever be).

Check which account your IIS runs under and give to that user read / write rights to the folder.

If this helps, please take time and accept the solution. Thank you.
 
Share this answer
 
v2
Comments
Am Gayathri 16-Oct-14 7:36am    
How can i check this? Now am running application in local host
Sinisa Hajnal 16-Oct-14 8:11am    
Come on! Do some research! Look here: http://stackoverflow.com/questions/4269431/asp-net-which-user-account-running-web-service-on-iis-7

You can find others for your particular IIS. It is irrelevant if you're running localhost or remote IIS, the logic is the same.
Give Acess permission to the Folder ,means give permission to the IIS User to read & write option.
 
Share this answer
 
Comments
Am Gayathri 16-Oct-14 7:35am    
How can i do this ?
Am Gayathri 16-Oct-14 7:35am    
Am running my code in local host
Pravuprasad 16-Oct-14 8:22am    
go the folder where you create your Excel file,then right click,choose properties,then click on security tab,then click on edit,then choose add,then click on advanced,then click on find now ,then select everyone choose fuul control,then ok.
If your application is Desktop App than run your application as Run as Administrator and It should work.
 
Share this answer
 
Comments
Sinisa Hajnal 16-Oct-14 8:09am    
asp.net = web
Ashok G Patel 16-Oct-14 8:12am    
actully i didn't seen that in question so.. its ok.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900