title: ASP.Net MVC - Best Datatype Choice for Passing Uploaded File as a parameter to a Service Layer
body: <p>I'm implementing a file upload feature, and want to pass the uploaded file from the controller to a service layer that will do the processing (saving to disc, db updates etc). </p>
  
  <p>I'm following Phil Haacked's example:</p>
  
  <p><a href="http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx" rel="nofollow">http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx</a></p>
  
  <p>The uploaded file is coming into the Controller's Action method as a parameter of type 
  System.Web.HttpPostedFileBase. </p>
  
  <p>I could simply pass this parameter directly to the service layer and call all the convenient methods and properties from it to get the job done, but I would rather not have my service layer have a dependency on System.Web. </p>
  
  <p>Is there a better or "Standard" datatype to chose when passing file content and file metadata (E.G. Filename) in a .Net application?</p>