We're currently storing PDF files as binaries in Tridion (SDL Tridion 2013 SP1) and using DD4T, we can retrieve these files and display them as a list of links.
What I want to know is if it's possible to get the binary content of these files in the solution (instead of their URL, title, etc.) so that I can process it (calculate the file size and get the file extension).
When accessing the component presentation as shown by a code sample below, I'm only able to retrieve component, component template, page, order on page, etc.
public ActionResult RandomLinks(IComponentPresentation componentPresentation)
{
if (componentPresentation == null) throw new ArgumentNullException("componentPresentation");
var model = ComponentViewModelBuilder.Build<RandomLinksViewModel>(componentPresentation.Component);
return View(model);
}
Is there a way to retrieve the content similar to the Tridion.Extensions.Mediators.Razor.Models:
var binaryContent = component.TridionObject.BinaryContent;
Any help would really be appreciated.