I have a problem trying to access a file from a shared folder on the local network.
When I run the application in Visual Studio, it works fine and I can upload the file, but when I deploy the application in IIS, it just doesn't work.
I do not understand why, because I give full permissions to all users, including NETWORK SERVICE and IIS_USR.
I am currently using my computer to verify this. It has Windows 7 and works with IIS 7.5. The shared folder I'm trying to access is a Windows Vista installation that does not have IIS installed.
Code for downloading the file:
protected void button_Click(object sender, EventArgs e)
{
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=S10.png");
Response.WriteFile(@"\\192.168.1.82\Machine\file.png");
Response.End();
}
and this gives me the following error:
: -. .
: System.UnauthorizedAccessException: Acesso negado ao caminho '\ 192.168.1.82\Machine\file.png'.
ASP.NET . ASP.NET . ASP.NET ( {MACHINE}\ASPNET IIS 5 IIS 6 IIS 7 IIS 7.5), , . , ( IUSR_MACHINENAME) .
ASP.NET , , "" "". "", . ASP.NET .
, - .
.