Do I need to beware of any performance issues if I pass a large file (50 MB) from an http request as a parameter from a Web Api controller to a static function?
E.g.: Web Api controller:
[HttpPost]
[Route("UploadImage/{taskID}")]
public HttpResponseMessage UploadImage(int taskID)
{
using (MyEntity entities = new MyEntities())
{
var httpRequest = HttpContext.Current.Request;
foreach (string file in httpRequest.Files) {
Util.SaveImage(file, taskID);
}
}
}
Util class:
public static class Util
{
public static void SaveImage(string file, int taskID)
{
//Save file to disk
//...
}
}
Will there be a performance hit by passing that file as a string from the controller to a static method Util.SaveImage()? They both exist in the same project.