473,789 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebClient class data uploading methods...

I have successfully used the WebClient to access a web site using the
name-value list to send name=value pairs for a database query that is
run on the far end. I get the results back and all is fine.

The problem is that the queries I can send are limited because of the
way the namevalue collection works. The database query 'decoder' at the
far end expects that multiple values for the same field (or name) be
sent in multiple tags, so that a field named 'partno' with three
potential values would be sent in CGI as

'...&partno=234 &partno=456&par tno=789...'.

The .NET nameValueCollec tion interprets the same situation and reformats
this to be

'...&partno=234 ,456,789...'

which is not acceptable by the query decoder at the far end (over which
I have no control).

Using the WebClient.Uploa dData with a byte array containing the query
string, I can get the proper data to post to the web site - at least it
all looks identical in the packets, as far as I can tell. But the query
decoder won't accept it and tells me that the query is invalid.

I can take the data from the two different methods (copied from the
packets even) and paste it into a text editor and compare it character
by character and there seems to be no difference. Obviously, something
actually is different...

Can anyone suggest another possible problem?

Thanks a lot!
Pete
Mar 29 '06 #1
0 996

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2051
by: mc kim via .NET 247 | last post by:
What I am trying to is automatic bidding process in Ebay site... WebClient class can uploads form data easily. I have collected ebay url & form data to uploads.. Most of process is quite easy and simple. But ebay webserver send me your password is not valid... But the password is clearly correct.. you can type it at the result page and submit. Then you can see a message - bidding has ended and you are logged in. <- This is the message...
3
2485
by: Bruno Otero | last post by:
Hi! I have a program that excutes the following code: DirectoryInfo diretorio = new DirectoryInfo(@"C:\teste"); FileInfo arquivos = diretorio.GetFiles("*.xml"); for(int contador=0;contador<arquivos.Length;contador++) { lblMensagem.Text = "Uploading files... ";
1
3257
by: Arash | last post by:
Hi everybody, the previous error was my mistake but right now I changed the code to: private void btnUpload_Click(object sender, System.EventArgs e) { WebClient mClient = new WebClient(); try{ mClient.UploadFile(" http://mymachine/Pars/Images/Cop.jpg ","D:\\Cop.jpg"); }catch(Exception el){
2
2057
by: Federico Bari | last post by:
I have the necessity to send an xml file to a CGI application using the https protocol (then the CGI application have to store the datas of the xml file in a mySQL database). I saw the useful WebClient class for C#, but it isn't explained in which variable i can find the file on the server side. Can you help me? thank you! Federico.
6
12247
by: genc ymeri | last post by:
Hi, We are struggeling to upload a file through a C# webClient into JBoss web server. Meanwhile we are able to upload a file from the webserver itself. The problem is only with C# webClient . The code is pretty simple. string uriString = saveTargetToAddress.Text; string postData = textOutput.Text; try
3
7590
by: Manuel | last post by:
I have an asp page ("test.asp") that presents the data it receives from a post.When I try the following code, test.asp doesn't return the values (supposedly) posted to it. If I make a web page with a form and the values, test.asp reports them fine. ---------------------------- Dim thePost As String = "Variable1=Value1&Variable2=Value2&Variable3=Value3" Dim thePage As Byte() Dim MyWebClient As New System.Net.WebClient
3
1132
by: Flashster | last post by:
I'm a beginner so please be gentle..... I want to (if its possible) post information to a web based form from my windows form app and receive the resulting data from the web page. The web forms code appears to be in javascript (not sure if that is relevent). I have tried, as a test, using the example code (see below), but the only data I get back is the actual web page the data is on, without the resulting
1
1324
by: Chris Dunaway | last post by:
I am using the following code to test an .aspx page which has no presentation and only a handler for the Page_Load event. I am using this code to POST the contents of an .xml file to the .aspx page. The page received the file just find and uses Response.Write to send back a response to indicate it received the file. I am at a loss to understand how to get this response back from the WebClient.
2
10176
by: MichaelSchoeler | last post by:
Hi, I'm having problems with the WebClient class regarding UTF-8 encoded data. When I access a specific webservice directly I can see the data arrives in corretly formatted UTF-8. But when I try to pull data from the same webservice url through the WebClient class I get partly garbled UTF-8 data in return. Only some UTF-8 chars (double byte pairs) seems to be corrupted. // Does not work WebClient wc = new WebClient(); string...
0
9663
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.