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
Jimmy Mac
NA
4
10.4k
Error -The server committed a protocol violation in MVC 4
Sep 12 2013 3:33 AM
Hi everyone,
First, please you view my code use to upload file to mediafire
public static void uploadFile(string folder_key, HttpPostedFileBase file)
{
System.Net.WebClient Client = new System.Net.WebClient();
Client.Headers.Add("Content-Type", "binary/octet-stream");
string filename = HttpContext.Current.Server.MapPath("~/Images/orderedList1.png");
string UploadURI = "http://www.mediafire.com/api/upload/upload.php?session_token=" + token.session_token + "&uploadkey=" + folder_key + "&response_format=json";
var request = (HttpWebRequest)HttpWebRequest.Create(UploadURI);
var res = Client.UploadFile(UploadURI, "POST", filename);
}
- Red code have error below: "The server committed a protocol violation. Section=ResponseStatusLine". Althought, I inserted code below to web.config:
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing = "true"/>
</settings>
</system.net>
</configuration>
- So how to fixed this error ?
Thank you so very much.
Cheers.
Jimmy Mac.
Reply
Answers (
2
)
C#.NET
Whole information and each & every in asp.net, C#