开发者

Send Image as http response

I am downloading bytes from a URL link ( which is a link to pdf file)

WebClient imageWebClient = new WebClient();
response.Image = imageWebClient.DownloadData(Url);

for other images types I am doing following, I am not sure how am I supposed to show this image which is extracted from a pdf file.

context.Response.AddHeader("Content-Disposition",开发者_JS百科 "inline;  filename=image.jpg");
                            context.Response.ContentType = "image/jpeg";

streamBitmap = new MemoryStream(response.Image);  //GetBitMapStreamFromData(CheckImg.ImageData);
if (streamBitmap != null)
{
    streamBitmap.WriteTo(context.Response.OutputStream);
}

This doesn't work for bytes received by above code from a pdf link.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜