473,387 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

WebClient class transfer file problem

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.
Nov 15 '05 #1
2 2038
Federico,

Are you supposed to send the file as a file, or do you want to send the
contents of the file? If you want to send the contents of the file as part
of the request, then chances are you have to POST the contents, and you can
do so with one of the overrides for DownloadData.

As for uploading an actual file, you can use the UploadFile method on
the WebClient class to upload the appropriate file to the server.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Federico Bari" <fe********@tiscali.it> wrote in message
news:bu**********@lacerta.tiscalinet.it...
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.

Nov 15 '05 #2
yes i saw that i can use UploadFile ... i have the problem on the server
side, not the client. The client have to upload the file ... on the other
side i have a cgi server application that take this file and do what it has
to do. The problem: which is the name of the cgi enviroment variable who has
the file data? How can i refer to the recieved data inside the php or perl
application? Thanks, Fede.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> ha
scritto nel messaggio news:%2****************@TK2MSFTNGP10.phx.gbl...
Federico,

Are you supposed to send the file as a file, or do you want to send the contents of the file? If you want to send the contents of the file as part of the request, then chances are you have to POST the contents, and you can do so with one of the overrides for DownloadData.

As for uploading an actual file, you can use the UploadFile method on
the WebClient class to upload the appropriate file to the server.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Federico Bari" <fe********@tiscali.it> wrote in message
news:bu**********@lacerta.tiscalinet.it...
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.


Nov 15 '05 #3

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

Similar topics

1
by: Sven Putze | last post by:
my target: I want to upload a file via HTTP Post and show the user a progress bar my 1st try: I´ve used WebClient.UploadFile and WebClient.UploadData, they work fine but I don't know any...
6
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...
9
by: Glen | last post by:
I'm writing a console utility to download specific files from web sites based on the command line options. In most cases, I can trap the 404 error when the file isn't available because the...
6
by: A.M-SG | last post by:
Hi, I have an aspx page at the web server that provides PDF documents for smart client applications. Here is the code in aspx page that defines content type: Response.ContentType =...
3
by: bss2004 | last post by:
Help! I'm posting a PDF Doc to a remote server using WebClient UploadData and the following code. The DOC posts fine and the server returns a positive response. If I access the remote file in...
4
by: ewolfman | last post by:
Hi, This may sound a little complicated, but here goes: I have 2 webforms (lets call them 'x' and 'y'). * - 'x' is a form which contains a single server side TextBox web control, and an...
2
by: kkb | last post by:
Hello! First, I'm sorry because of my english... I'll try to be understandable! I've got a strange problem using .NET 2003 C# and I haven't figured it out for a long time. I'm implementing an...
2
by: Amos Soma | last post by:
I am using WebClient to upload a file to a remote server. The call I'm making looks as follows: webClient.UploadFile("http://sdtpcal.someserver.com/Federation/Databases/Federation.Zip",...
4
by: Natalia | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On http://aspalliance.com/236#Page4 - I found great...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.