开发者

displaying images in mvc.net c#

开发者 https://www.devze.com 2023-01-10 09:57 出处:网络
i want to dis开发者_开发知识库play images in mvc.net? help anybody :)... im uploading images through silverlight control and storing them on directory at my hard diski assume that you like to create a

i want to dis开发者_开发知识库play images in mvc.net? help anybody :)... im uploading images through silverlight control and storing them on directory at my hard disk


i assume that you like to create an action which give the picture to the client, that's easy.

 public ActionResult ResizedPicture(int pictureId)
 {
   var picturePath= GetPicturePathFor(pictureId);
   return File(picturePath, "image/jpeg"); 
 }

The Story is the return a FileResult, they are plenty overload for FileResults, so that can return an Stream, Byte-Array or give the path to a file.

GetPicturePathFor() is a not part of mvc.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号