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
Naresh Babu Gopavaram
1.5k
248
249.1k
Generate HTTpResponse message from FileStream in .Net4.0 .
Sep 29 2014 5:19 AM
Hi All
I have used the following code to generate HTMLResponseMessage in
WCF Rest Service
with .Net 4.5 . But I need to generate the same in .Net 4.0 version. I could not able to find the solution.
Can any one help me on this
public static HttpResponseMessage GetFile()
{
string file=@"C:/test.docx";
var rv = new HttpResponseMessage(HttpStatusCode.OK);
var stream = new FileStream(file, FileMode.Open, FileAccess.Read);
rv.Content = new StreamContent(stream);
rv.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
return rv;
}
Thanks in advance
Reply
Answers (
0
)
Visblechanged event is not triggered properly
question about datetimepicker