Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

We are getting this error when we exporting report ..

Error: Access to the path 'C:\Inetpub\vhosts\shoppersonlineclub.com\site1\Data\Report.xls' is denied.
Posted

It looks like you are trying to write to a file location on your web server. The error is self evident (you don't have access to that location). However, fixing it can be tricky. If you are trying to save this file from a web application, you need to make sure that the account that is running your application pool has rights to that location on the disk. However, this may not be what you are looking for. If you want to save the file to the client's machine, this isn't how to do it. You would want to send the file to the client, not have the server save the file to disk. If that is the case, let me know and I can give you some example code (just tell me what language).

If you are trying to save files on the server, you will need to make sure the permissions are set properly. Here is a great Stack Overflow question/answer that will help you out in this area (it even has pictures):

http://stackoverflow.com/questions/5437723/iis-apppoolidentity-and-file-system-write-access-permissions[^]
 
Share this answer
 
v2
Comments
vivekasp 4-Jun-12 6:12am    
Hi
Thanks for the reply
We are trying to create a reporting from database when we are trying to export it we are facing this kind of error ,can you pls suggest a alternative fro this ..issue
Please help
Tim Corey 5-Jun-12 7:29am    
If you are attempting to save it on the server, you will need to make sure that the account that IIS is running under has access to the folder you want to save the files to. I've updated my answer with a link to a Stack Overflow question that walks you through checking permissions for saving files with IIS.
You need to make sure that at the very least the Data folder has write permissions to everybody - or at least to the appropriate user for your software.
 
Share this answer
 

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