I think this question is repeated in many places. But I would like to know the better solution which won't give overhead to server.
My scenario is like a user should be able to click on a link in website and that link will get the correct file from server and send it to user.
I see solutions like below,
string filename1 = "newfile.txt";
string filename = @"E:\myfolder\test.txt";
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=\"" + filename1 + "\"");
Response.TransmitFile(filename);
and like in below post,