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
Teemee Tang
NA
111
10.4k
Error uploading image (in bytes) to a HTTP File server
Jun 21 2018 12:12 AM
I am trying to upload an image (in bytes) from a HTTP server. I am encountering an error "An existing connection was forcibly closed by the remote host" when using the code below. DownloadData and UploadFile methods are working. Please help.
string image = @"C:\.....\helloX2.pdf";
byte[] ImageData = System.IO.File.ReadAllBytes(image);
Uri _uri = new Uri(@"http://XXX.XXX.XX.X:8080/MyHTTPFileServer/helloX2.pdf");
WebClient client = new WebClient();
client.Credentials = CredentialCache.DefaultCredentials;
byte[] responseArray = client.UploadData(_uri, "POST",ImageData);
string x = Encoding.ASCII.GetString(responseArray);
client.Dispose();
Reply
Answers (
1
)
how to store ocelot configuration in consul
Application to check typing speed and accuracy