I'm trying to download a file from my local computer, which is in a library sharepoint. I'm using this function :
try
{
siteURL += "?NoRedirect=true";
System.Net.WebClient _WebClient = new System.Net.WebClient();
_WebClient.Credentials = CredentialCache.DefaultCredentials;
// Downloads the resource with the specified URI to a local file.
_WebClient.DownloadFile(siteURL, saveName);
}
catch (Exception _Exception)
{
// Error
//MessageBox.Show("Error In Downloading");
}
and where saveName is equal to : string pathToDesktop = Environment.ExpandEnvironmentVariables("%USERPROFILE%") + @"\Desktop" + "\Export-" + filenamexls;
The thing is that i want to download the file on my computer and not on the server. But I don't know how to do this.
Can someone help me on this one ?