473,322 Members | 1,523 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,322 software developers and data experts.

Binary data and BinaryFormatter!

Hi all,

I have a web app that exports a dataset to an XML file, the customer
now wants this XML file to include media as well (Word, JPEG, bitmap
and many other formats I might not expect). I've got the dataset
exporting great, but I cannot figure out how to append multiple binary
files in XML format.

Using BinaryFormatter I have been able to simply append a chunk of
Base64 encoded data to the end of the XML, but it needs to be delimited
so that I can extract the separate media items on the other end.

e.g.
<NewDataSet>
<References>
<ReferenceID>19</ReferenceID>
<CreatedBy>0</CreatedBy>
<DateCreated>2005-05-12T15:44:00.0000000+01:00</DateCreated>
</References>
<References>
<ReferenceID>6</ReferenceID>
<CreatedBy>0</CreatedBy>
<DateCreated>2005-05-26T12:07:22.0000000+01:00</DateCreated>
</References>
</NewDataSet>
AAEAAAD/////AQAAAAAAAAAPAQAAAPQsAAAC/9j/4AAQSkZJRgABAgEAlgCWAAD/7QwCUGhvdG9zaG9wIDMuMAA4Qkl
The final output the customer would like is;

<NewDataSet>
<References>
<ReferenceID>19</ReferenceID>
<CreatedBy>0</CreatedBy>
<DateCreated>2005-05-12T15:44:00.0000000+01:00</DateCreated>
</References>
<References>
<ReferenceID>6</ReferenceID>
<CreatedBy>0</CreatedBy>
<DateCreated>2005-05-26T12:07:22.0000000+01:00</DateCreated>
</References>
</NewDataSet>
<MediaItems>
<Media>
<ID>1</ID>
<Content>AAEAAAD/////AQAAAAAAAAAPAQAAAPQsAAAC/9j/4AAQSkZJRgABAgEAlgCWAAD/7QwCUGhvdG9zaG9wIDMuMAA4Qkl</Content>
</Media>
<Media>
<ID>2</ID>
<Content>Some more binary content here</Content>
</Media>
<MediaItems>

Would anyone be so kind as to give me a few clues?

Nov 12 '05 #1
0 929

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

Similar topics

2
by: TJO | last post by:
I need a quick way to binary serialize an ArrayList of System.Drawing.Point objects. There are a lot of point is this list so I am trying to avoid iterating over them. I have tried the following...
11
by: ajou_king | last post by:
I was running some tests on my Win32 1GHZ processor to see how long it would take to transmit objects numerous times via TCP/IP using C# ..NET Remoting vs the C++ trustworthy method of binary...
5
by: Samuel R. Neff | last post by:
Are there any tools available to view a file containing a binary serialized object in a friendly format? Something to list classes and data and such? Thanks, Sam B-Line is now hiring one...
1
by: Manjunath sp via DotNetMonster.com | last post by:
Hi, How to effectively write and read structures from binary files in .Net? Currently I am using functions like ReadInt32 and the likes to read data from binary file into each elements of a...
7
by: schoenfeld1 | last post by:
I've implemented IPC between two applications using named pipes and binary serialization, but have noticed that the binary formatter is rather slow. It seems that the binary formatter reflects...
5
by: Phil Kelly | last post by:
Hi I need to write the contents of a structure to a binary file - there is one string and 2 integers, but I can't seem to figure out how to write the data correctly. If I am simply writing...
5
by: Harold Howe | last post by:
I am having a problem deserializing objects from a library when the following conditions exist: 1- The library is strongly named 2- The serialized file was created with version 1.0 of the...
12
by: =?Utf-8?B?enRSb24=?= | last post by:
Hi all, I recently came across something really strange and after a couple of days of debugging, I finally nailed the cause of it. However, I have absolutely no idea what I am doing wrong or is...
3
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I'm trying to write an array of structures named myStructArray to a binary file and later on read it back. Although I could complete the entire project in C in about 2 minutes, I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.