Hi,
I am working on a SharePoint 2010 Visual WebPart, the saves a SSRS report as pdf on a button click. The code is mentioned below:
HttpWebRequest Req = (HttpWebRequest)WebRequest.Create(URL);
Req.UseDefaultCredentials = true;
Req.PreAuthenticate = true;
Req.Credentials = CredentialCache.DefaultNetworkCredentials;
HttpWebResponse objResponse = (HttpWebResponse)Req.GetResponse();
Req.Method = "GET";
//Specify the path for saving.
string path = @"C:\test\" + quoteID + @".pdf";
FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write);
Stream stream = objResponse.GetResponseStream();
byte[] buf = new byte[1024];
int len = stream.Read(buf, 0, 1024);
while (len > 0)
{
fs.Write(buf, 0, len);
len = stream.Read(buf, 0, 1024);
}
fs.Close();
stream.Close();
The code works great, however, when the user clicks the button the file is getting saved directly in the main server when the WebPart is deployed. So, now I want the user to be able to select the location in there system to save the file. How to enable the "Open save file dialog" and let the user select the location. can someone help me with this ?
t