I have a webpage, where in which there is an option to get the gridview data to excel and send a mail with that excel as attachment. For this, I am exporting the grid view data to an excel, put that in shared path and call "master.xp_sendmail " stored procedure
( passing the shared path as a parameter @attachment to the sp. The stored procedure goes to the path and picks the file and attach it to the mail.
I have tested this in local machine and it worked fine. But, after hosting this to server, it throws an exception saying "Access to the path denied".
Also, as said, a question pops, are you familiar with SQL Profiler?if so, please get to know the working of your hosted server stored proc. The working of SP should be as expected your local machine on which tested.
siva-karthik
Member
13 Points
41 Posts
Access to shared path is denied after hosting the webpage in server
Apr 06, 2012 05:26 AM|LINK
Hi,
I have a webpage, where in which there is an option to get the gridview data to excel and send a mail with that excel as attachment. For this, I am exporting the grid view data to an excel, put that in shared path and call "master.xp_sendmail " stored procedure ( passing the shared path as a parameter @attachment to the sp. The stored procedure goes to the path and picks the file and attach it to the mail.
I have tested this in local machine and it worked fine. But, after hosting this to server, it throws an exception saying "Access to the path denied".
Please help me out of this issue.
Thanks in advance,
Karthik.
HostingASPNe...
All-Star
15876 Points
2974 Posts
Re: Access to shared path is denied after hosting the webpage in server
Apr 06, 2012 05:32 AM|LINK
Hello,
You should give security write permissions to the application pool user (IIS7) to that folder.
Regards
Free ASP.NET Examples and source code.
siva-karthik
Member
13 Points
41 Posts
Re: Access to shared path is denied after hosting the webpage in server
Apr 06, 2012 05:37 AM|LINK
hi,
Could you please eloborate ? I am totally new to this.
aspnet2sams
Participant
1744 Points
540 Posts
Re: Access to shared path is denied after hosting the webpage in server
Apr 06, 2012 06:17 AM|LINK
siva-karthik,
further to suggested post.
Add asp.net user to your shared path folder as follows:
1. From context menu select properties
2. Add user asp.net with permissions Read, Write, Full and click ok.
give your trials opinion on forum.
siva-karthik
Member
13 Points
41 Posts
Re: Access to shared path is denied after hosting the webpage in server
Apr 06, 2012 09:40 AM|LINK
Hi,
I did like below.
Right click on folder - > properties -> security -> Add -> (added my user name) -> checked on Full control.
And tried sending mail, didnt work. same exception "Access to the path denied"
Thanks,
Karthik
aspnet2sams
Participant
1744 Points
540 Posts
Re: Access to shared path is denied after hosting the webpage in server
Apr 06, 2012 01:02 PM|LINK
Okay,
try asp.net instead with steps repeat.Also, as said, a question pops, are you familiar with SQL Profiler?if so, please get to know the working of your hosted server stored proc. The working of SP should be as expected your local machine on which tested.
carl.steinha...
Participant
922 Points
247 Posts
Re: Access to shared path is denied after hosting the webpage in server
Apr 07, 2012 02:51 AM|LINK
Hello siva,
You need to add IIS_WPG and grant the permisson to your usr. Please kindly retry. :)
Carl Steinhart
siva-karthik
Member
13 Points
41 Posts
Re: Access to shared path is denied after hosting the webpage in server
Apr 09, 2012 05:38 AM|LINK
Hi Carl,
If i am not wrong, is it like i need to create a group named IIS_WPG and add the user to that group and then grant the access ??
If it is so, how can we know all the users who may access this path? is there anything like we can add a group of users ???
Thanks,
Siva Karthik N
siva-karthik
Member
13 Points
41 Posts
Re: Access to shared path is denied after hosting the webpage in server
Apr 09, 2012 07:05 AM|LINK
Hi,
I tried to add asp.net to the folder i have created. But it doesnt allow me to add, saying "the object named asp.net can not be fount". Any ideas ???
Thanks,
Karthik
aspnet2sams
Participant
1744 Points
540 Posts
Re: Access to shared path is denied after hosting the webpage in server
Apr 10, 2012 02:28 AM|LINK
siva-karthik
network domain name OR computer name OR basically machine identity \ OR / asp.net (user name).
give forum opinion about trials.