Reputation: 73
I have a WCF application that downloads a file from an external web, in development mode it works perfect, but on the IIS server it does not download the file.
URLDownloadToFile(0, "URLFile", HttpContext.Current.Server.MapPath("~/temp/") + "img.gif", 0, IntPtr.Zero);
some help?
Upvotes: 0
Views: 83
Reputation: 15281
URLDownloadToFile is part of WinInet, which is not supported under a windows service like IIS. See INFO: WinInet Not Supported for Use in Services for details.
Since you are using WCF, a more natural way to download files is to use the WebClient class in System.Net.
Upvotes: 1