For asp.net users, the .NET framework provides a class to create a content disposition header: System.Net.Mime.ContentDisposition
Basic usage:
var cd = new System.Net.Mime.ContentDisposition();
cd.FileName = "myFile.txt";
cd.ModificationDate = DateTime.UtcNow;
cd.Size = 100;
Response.AppendHeader("content-disposition", cd.ToString());