开发者

set html img src from byte array

开发者 https://www.devze.com 2023-03-19 20:09 出处:网络
I am working on an email client application in C#. I want to display an html email on the page with embedded images.

I am working on an email client application in C#.

I want to display an html email on the page with embedded images. Now, I use a div and set mail bodyhtml to div innerhtml property. I have a problem with display embedded images.

I know everything about embedded images (content-type, name, content-id, base64string or byte[] as content)

I used image data uri, but unfortunately it is not too perfect, for example (ie8-32KB limitation).

I tried to ihttph开发者_Python百科andler as imagehandler, but it is not run on a simple postback, when I set div inner html.

I don't want to save these images on the server.

Any idea or suggestion?

Sorry, my english is not too good.

Thanks.


For doing this, you would need to do something like:

(In your .ashx file)

 Response.ContentType = "image/png";
 Response.BinaryWrite( <bytes> );
0

精彩评论

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