Questions tagged [webclient.uploaddata]

31 questions
6
votes
1 answer

C# remote web request certificate error

I am getting the following error when trying to perform a HttpWebRequest to a remote server over SSL (the url is https://sandbox.payfast.co.za): "The remote certificate is invalid according to the validation procedure" The certificate seems to be…
Ben Foster
  • 34,340
  • 40
  • 176
  • 285
6
votes
1 answer

How to upload GZip compressed data using System.Net.WebClient in C#

In my project I need to upload large JSON data from a desktop app. So, I need it to be compressed. I searched everywhere but I did not find a complex solution to my problem. So, I put several snippets together. See the answer below. I hope you find…
petriq
  • 969
  • 1
  • 11
  • 24
4
votes
3 answers

Duplicate webClient requests sent at exactly the same time from ajax call

The problem I am facing is that the webClient.UploadData method is firing twice instantly from ajax request. But the same webClient.UploadData method is firing only once when invoked from aspx page. From the logs I can see the time of both the…
Gopi
  • 227
  • 2
  • 10
  • 30
4
votes
1 answer

Post collection of C# objects using WebClient

I am trying to post to an ASP.NET MVC action from another Action (separate sites) and I need to post a collection of objects. I'm unable to find how to serialize this collection of objects so I can get them as a standard NameValueCollection. …
Jorin
  • 1,652
  • 1
  • 19
  • 25
4
votes
1 answer

What is basic difference between UploadData and DownloadString in asp.net webclient?

I am new to webclient. I have seen some examples to POST data to a server. I am worrying which one to be used over other. Can any one please tell me what to use when? UploadData: system.net.webclient.uploaddata(uri,…
SHEKHAR SHETE
  • 5,964
  • 15
  • 85
  • 143
2
votes
1 answer

Trouble with WebClient.UploadData

I have a client-server type application with the server running HttpListener and the client uploading data to the server using WebClient.UploadData. The code works quite well (whith large data buffers 60K and up) except one installation where…
alecd4
  • 309
  • 2
  • 13
2
votes
0 answers

how to upload byte array in netcore

this example code in netframework 4.6 byte[] myByte = etc; WebClient webClient = new WebClient(); webClient.Headers.Clear(); webClient.Headers.Add("Content-Type", "application/json"); webClient.Headers.Add("Authorization", "Bearer " +…
TestIt
  • 57
  • 1
  • 4
1
vote
1 answer

WebClient.UploadData and Internal 500 error

everyone. I'm programming with c# language and I have a problem with WebClient class. I downloaded an image by using method WebClient.DownloadData, it worked fine. But, WebClient.UploadData didn't. In details, I have a byte[] contains a image's…
Michelle
  • 13
  • 1
  • 1
  • 4
1
vote
2 answers

Replicate steps in downloading file

I'm trying to automate the download of a file from a website. Normally to download the file, I login with a username and password. Navigate to a particular screen then click a button. I've been trying to watch the sequence of POSTs using Chrome's…
bpeikes
  • 3,495
  • 9
  • 42
  • 80
1
vote
2 answers

MySQL: LOAD DATA LOCAL INFILE adds extra character '\r'

I have a table like this: CREATE TABLE `tblinquiries` ( `UID` varchar(50) DEFAULT NULL, `ReviewDate` date NOT NULL, `InquiryId` varchar(50) DEFAULT NULL, `AuditStatus` varchar(50) DEFAULT NULL, PRIMARY KEY (`InquiryId`) ) ENGINE=InnoDB…
Lone Rider
  • 97
  • 2
  • 10
1
vote
1 answer

upload serialized data using WebClient

Simple requirement . I have a class - User - {userId, userName, age}. How to serailize a object of the class and sent to a url (using post) using webclient. Something Like below. What is the best way to serialise user object into postdata…
1
vote
2 answers

WebClient.UploadData error: (401) Unauthorized

I'm getting this error... What is puzzling me is the fact that i do not have any type of security enabled for the page i'm invoking... WebClient myWebClient = new WebClient(); myWebClient.UploadData(myUrl,"POST", myByteArray); When i access…
Sergio
  • 8,125
  • 10
  • 46
  • 77
1
vote
0 answers

Upload a file to asp server

I need to upload text files from my desktop application to webserver that i host i have followed this tutorial ( http://msdn.microsoft.com/en-us/library/36s52zhs.aspx ) however i get this error when i run my code. the remote server returned an error…
Umar Iqbal
  • 669
  • 1
  • 11
  • 31
1
vote
3 answers

Upload text file to web service

I have following method which accepts a text file and I am trying to upload this text file on the web service. I use a user name and a password. But I get an exception: "The remote server returned an error: (404) Not Found.". If I supply the user…
user1399377
  • 469
  • 2
  • 7
  • 19
1
vote
1 answer

Post Method in Webclient

web service post method is new for me. can u pls help me out what am i doing wrong. WebClient webClient = new WebClient(); webClient.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; webClient.Encoding =…
1
2 3