1

In my asp.net mvc3 project I have attachments section where user can upload his confidental images(scanned contracts), which i store on remote server. But when i render attachments i don't want to give full URI of image like

<img href="http://imageURI..." />.

I think i can render them trough controller action like

public ActionResult RenderImage
{
    return File(...);
}

but in method File I can't pass URI path.

Can anyone suggest me better solution.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364

1 Answers1

0

If the client browser is not IE8, just use Data URI Image. Check this out.

@Html.DrawImage("content/images/cat.jpg","funny cat")

Output

<img alt="funny cat" src="data:image/jgp:base64,________" />
Thurein
  • 2,536
  • 7
  • 34
  • 49