Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 29th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. download file to a specific location with Response.BinaryWrite and Server.Mappath possible?
  2. //a is my attachment object
  3. var r = context.Response;
  4. r.AddHeader("Content-Disposition", "attachment; filename=" + a.FileName);
  5. r.Charset = "";
  6. r.ContentType = a.MIME;  
  7. r.BinaryWrite(a.Content.ToArray());