TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jose Saiz
1.5k
260
102.9k
How to convert .OutputStream to byte[] array
Mar 21 2020 11:36 AM
Hi Guy I am having dificulty trying to convert from HttpContext.Current.Response.OutputStream to a byte[] array
This is my code
byte
[] myBuff =
new
byte
[16384];
using
(var memoryStream =
new
System.IO.MemoryStream())
{
HttpContext.Current.Response.OutputStream.CopyTo(memoryStream);
myBuff = memoryStream.ToArray();
}
but I get the following error message "Stream does not support reading."
the HttpContext.Current.Response.OutputStream carries an image contentype="image/GIF"
Any Idea what I'm missing or doing wrong?
TIA
Reply
Answers (
2
)
Did anyone worked on veracode flaws CWE 601 in MVC
How to print RichText Box data in crystal report