Hi, this web method works okay on my local environment, but not on Winhost Code: [WebMethod] public void TestDownloadFile() { WebClient wc = new WebClient(); wc.DownloadFile("http://sports.yahoo.com/nba/scoreboard", "site.txt"); } I get the following error message.... System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Net.WebClient.DownloadFile(Uri address, String fileName) at System.Net.WebClient.DownloadFile(String address, String fileName) at Service.TestDownloadFile() Is there location where we are allowed to save files to?
Problem fixed. These are the 2 things that needed to be done... <system.web> <trust level="Full"/> and Code: [WebMethod] public void TestDownloadFile() { WebClient wc = new WebClient(); wc.DownloadFile("http://sports.yahoo.com/nba/scoreboard", HttpRuntime.AppDomainAppPath + "\\site.txt"); }