Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

This may be a fairly straightforward one, but not having done much work in this area I just wanted to throw it out there

 

I'd like to take a file, and prepend some data to it. This has to be done for several file types:

PowerPoint presentations (.ppt) - take an existing presentation, and insert a new first slide

Word Documents (.doc,.docx) - take a word document, add a new first page

Sound Clips, Podcasts (.mp3,.mwa) - take a clip, and prepend a new start section

Video Clips (.wmv,.mpeg) - same as for sound except with video

 

Anyay, you get the general jist!

 

Is this a case of just using a StreamReader and Streamwriter to create a new file based on merging the 2 existing ones??

 

Thanks

What if the Hokey-Pokey IS what it's all about?
Posted

The problem I see is that by writing anything to the beginning of any of these file types you will likely damage the headers rendering the files unusable by the programs that use them.

 

If that isn't a problem, then you should be able to do as you stated above, merge the two files.

Posted

yea was kind of thinking along those lines myself, the header info would get corrupted.

 

Maybe someone has done something similar, or there's tools around for various differnet type of files like mpegs, mp3s or Word Documents

What if the Hokey-Pokey IS what it's all about?
  • Leaders
Posted
The technique for each file type would be different. If you just prepend one file to another, most programs will probably only open the prepended data (based on the header from the prepended document) and ignore the remaining data. To do this properly, you have to work with the format of the documents. With office documents you could probably just interop with office. With audio and video files you would probably need special libraries, and even then the particulars can vary from format to format. In other words, you are looking at alot of work.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...