Home » Category » DotNet

DotNet: HtmlInputFile.SaveAs gives Access to Path Denied error

102| Sun, 06 Jan 2008 08:25:00 GMT| smetzger| Comments (4)

Hi,

I am trying to use HtmlInputFile.SaveAs to upload a file to the server. However, I get a "Access to path denied error" when I try to call the function.

I am guessing this is some sort of configuration problem on the Server. What do I need to change to give access?

Thanks,
Scott

Keywords & Tags: htmlinputfile.saveas, gives, access, path, denied, error, dotnet, .net

URL: http://dotnet.itags.org/dotnet-tech/313838/
 
«« Prev - Next »» 4 helpful answers below.

Well, you need to make sure that the web server user (usually ASPNET or NETWORK SERVICE, unless impersonation is used) has write access to the path where you want to save the file.

gunteman | Sun, 06 Jan 2008 08:26:00 GMT |

Looking at the properties in IIS I have the following properties...

Read, Write, Log Visits, Index this resource

I get the following error...

Access to the path 'C:\Development\BudgetSite\Interface\Project\support_area_emails.txt' is denied.

I there something else that needs to be done?

Thanks,
Scott

smetzger | Sun, 06 Jan 2008 08:27:00 GMT |

Hi Scott,

I agree with gunteman, this should be the permission issue. Please check the security list of that directory by the following steps:

1. Open Windows Explorer.
2. Go to "'C:\Development\BudgetSite\Interface\Project\".
3. Right click the "Project" folder, and then select "Properties".
4. Click "Security" tab.
5. Add "ASPNET" or "NETWORK SERVICE" with Read and Write permission. For troubleshooting purpose, you can temporally grant full control permission for Everyone.

bensonyu_msft | Sun, 06 Jan 2008 08:28:00 GMT |

ah, ok that was it.

We do they even have permissions in IIS if it needs to be managed at the OS level?

smetzger | Sun, 06 Jan 2008 08:29:00 GMT |

DotNet Hot Answers

DotNet New questions

DotNet Related Categories