I have a file stored in server and I need to download it to my local folder. Currently, it gives me the download prompt but I need to save the file automatically without any prompt to the specified folder path. How can I do that?
string path = @"C:\tmp";
string pathstr = Path.Combine(path, "JobData", "JSAttachments", mydate, lbljsno.Text);
Directory.CreateDirectory(pathstr);
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename);
Response.WriteFile(Path.Combine(pathstr,filename));
Response.End();