Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

How can I return image from controller asp.net

[AcceptVerbs(HttpVerbs.Get)]
[OutputCache(CacheProfile = "CustomerImages")]
public FileResult Show(int customerId, string imageName)
{
    var path = string.Concat(ConfigData.ImagesDirectory, customerId, "", imageName);
    return new FileStreamResult(new FileStream(path, FileMode.Open), "image/jpeg");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #I #return #image #controller
ADD COMMENT
Topic
Name
5+4 =