Question: My program generates doc file on browser and i want to save this file to my C drive dynamically 

```
string filename = "fileName"; 
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename= " + filename +".doc" );

Response.Charset = "";
Response.ContentType = "application/vnd.ms-word ";       
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
GridView1.AllowPaging = false;
GridView1.DataBind();
GridView1.RenderControl(hw);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();

```

Answer: 
You cannot decide for the user where to save the file. User decides that.
You can save a given location on the server, but you can't tell a client where to save a file in the HTTP response. Beyond the security problems inherent in that approach, you have to take into account that there are a diverse array of clients with different file structures. Even Windows clients do not necessarily have a C: drive. A few ActiveX controls could allow you to dictate a save location, but those are client-side code and recent version of Internet Explorer intentionally make that difficult to implement. Also, if the user is using some sort of download client, you can pre-populate a location, but if you don't know their file structure you're still going to have trouble.