473,491 Members | 2,205 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is it possible to embed a .zip file in XML string in C#?

sovitagar
8 New Member
Hi,
I am doing a project in C# wherein i need to send a xml string from server to client using TCP connection. The xml string requires to contain some data which the client can parse.My question is whether we can embed/include a .zip file or any other file as a tag value within this xml string ?
Please help...
Thanks in advance!!!
Apr 9 '14 #1
8 2615
Dormilich
8,658 Recognized Expert Moderator Expert
in principle you cannot embed binary data in XML. of course you can insert the string representation of the binary data or base64 encoded data into the XML code. whether the XML parser on the other side can work with that is another question.

and of course you dramatically increase the XML’s file size doing that.
Apr 9 '14 #2
sovitagar
8 New Member
Thanks Dormilich!!!
You mean to say that we cannot insert any data apart from the string representation of the binary data into the xml string?
So there's no way to insert even a text file into a xml string?
Apr 9 '14 #3
Dormilich
8,658 Recognized Expert Moderator Expert
it shouldn’t be too difficult to get the string representation of a plain text file’s text.
Apr 9 '14 #4
sovitagar
8 New Member
So can you help me out with embedding string representation of the binary data in a xml?
Like I don't know as to how can we embed the same in a xml...
Apr 10 '14 #5
Dormilich
8,658 Recognized Expert Moderator Expert
I’d try file_get_contents()
Apr 10 '14 #6
sovitagar
8 New Member
Well if you could help me out with something in C#....
Coz my project is in C#
Thanks So much!!!
Apr 10 '14 #7
Dormilich
8,658 Recognized Expert Moderator Expert
I don’t know C#. just JavaScript and PHP.
Apr 10 '14 #8
sovitagar
8 New Member
Anyways...Thanks a ton!!! :)
Apr 10 '14 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

5
4965
by: David Sobey | last post by:
Hi Sorry bout this basic prob. Got a file called file.obj. tryna read the first line from it as a string and print it to the screen. getting errors: #include "stdafx.h" #include <stdio.h>...
6
2838
by: NickName | last post by:
Env: SQL Server 2000 on in WIN NT 5.x Job: import mutiple flat files into several tables daily. Catch: one or two of the several flat files might be empty. First thought/test: Use option for...
5
3966
by: bissatch | last post by:
Hi, I have just managed to install DOMXML on my apache/PHP setup. I am running PHP 4.3.0 and Apache2. $xmldoc = domxml_open_file("inc/menu.xml", DOMXML_LOAD_DONT_KEEP_BLANKS); When I try...
1
1648
by: acool | last post by:
If I have an XML file in a string variable what is the best way to go about deleting specific Nodes or elements from this file??
2
1661
by: theinvisibleGhost | last post by:
Subject says it all really. I'm being passed a string, and I'm wondering if theres an easy way to determine what exactly the string points at? Cheers Chris.
2
1386
by: Nikolay Petrov | last post by:
I would like to embed a file in my EXE and extract it at runtime. Is this possible? If so how? the file is a MS Access Database. Would like to check if the file doesn't exists in the application...
0
961
by: Yasin cepeci | last post by:
is it possible that read string values in a filled dataset?
7
2524
by: rinkudhimar | last post by:
I am finding certain text and replacing it in the file. But it gets written three times in the file. I am sending the code. *******************HTML CODE********************************* <!DOCTYPE...
5
13536
by: Pawel_Iks | last post by:
Hello! I want to use following statement to pass command-line arguments into main function: int main(int argc, string argv) { if (argc>0) { //do something
7
164326
by: DannyMc | last post by:
Hi , i am in the middle of creating the script to match the string and replace it in mount.txt mickey:/work1 /work1 bla bla bla mickey:/work2 /work2 bla bla bla micket:/job /job bla bla bla
0
7115
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,...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
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
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3086
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...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
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 ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
280
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...

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.