Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

help needed

hi all....
i have one client program in visual studio .NET .. written in managed C++, which is sending some XML data to ASP server. and ASP server is receiving the XML data. Now i want to send one gif file along with XML data. so how i can send this from client to server ? if anyone have any idea or implemented code ... then plz let me know......

my email id id in1365c@motorola.com
[397 byte] By [manishkumarg] at [2007-11-11 6:49:43]
# 1 Re: help needed
.NET provides us some classes for this purpose. One is NetworkStream and other is TcpClient and third is TcpListener.

by making an object of TcpListener your class will behave like an Server.
by making an object of TcpClient you class will behave like a Client to that server.
These class constructors' require a port number which sould be same on oth sides and a hostname.
You will convert your GIF file to NetworkStream and pass it to then Send() bethod of TcpListener or TcpClient.On the other side will call ,probably, Rrecieve() mehotd to recive the file. MSDN will give u sample for that purpose.

as far as this XML thing is concerned, my knowledge is not much.
NabeeL at 2007-11-11 21:50:03 >
# 2 Re: help needed
One option is to encode the GIF data as characters and upload it as XML; see http://www.perfectxml.com/articles/xml/binary.asp for more information. Or, you may simply upload the GIF file in an HTTP POST; see http://www.freeaspupload.net/ for a free component to allow ASP file uploads.
Phil Weber at 2007-11-11 21:51:03 >
# 3 Re: help needed
thanx for replying...
but this is not usefull for me. because all these classes uses TCP or UDP protocols. i want the solution that uses HTTP protocol. because HTTP protocol can not be stopped by firewall. and as i told u ... that i have to send image ( gif file) along with XML data..
manishkumarg at 2007-11-11 21:52:07 >
# 4 Re: help needed
hi phil

do u have sample visual c++ .net program to convert gif file in to XML and then send this with another XML data from visual c++ .NET client to server. and at the server end it is received by ASP.
manishkumarg at 2007-11-11 21:53:02 >