Потоке MemoryStream на jQuery AJAX нагрузки от контроллера MVC
<img id="ItemPreview" src="data:image/png;base64,�PNGIHDRX�r5�sRGB���gAMA���a pHYs���o�dm#IDATx^���$w����7��s^����3lb���r�9�x<60x�,bm��ΰ̰�EHB�hAZ�ҍZڻ�RK�U�ڥ�.@l��Ȉ�'��FVV�/�ɬ���>�T�qg���TDv���?��?��?��?��?E�,{���o~�^|>
Что я уже пробовал:
[Authorize] [HttpPost] public FileResult CreateChart() { chart.ChartAreas.Add(chartArea); var ms = new MemoryStream(); chart.SaveImage(ms); GlobalSettings.SessionInfo["HomeChart"] = ms.GetBuffer(); return File(ms.GetBuffer(), @"image/png"); }
<img id="ItemPreview" src="" />
$.ajax({ type: "POST", contentType: "image/png", timeout: 10000, url: '@ViewData["BaseUrl"]/Home/CreateChart', success: function (data) { try { var ImgSrc = data $('#ItemPreview').attr('src', "data:image/png;base64," + ImgSrc); } catch (error) { } } });