Skip to content

Instantly share code, notes, and snippets.

@kyleondata
Created July 10, 2012 14:46
Show Gist options
  • Save kyleondata/3083739 to your computer and use it in GitHub Desktop.
Save kyleondata/3083739 to your computer and use it in GitHub Desktop.
C# code fore returning a file from CRM 2011
var id = new Guid(Request["id"]);
Repository.DocumentRepository documents = new Repository.DocumentRepository();
var results = documents.GetDocumentItem(id);
var f = File(Convert.FromBase64String(results.DocumentBody), Request["type"], results.FileName);
return f;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment