Is there a way to add metadata to a file?

J

JDeats

I have a binary file (zip file) that's being created by my app and I
would like to store a comma delimited list of items contained in that
file (e.g. the .zip file contains 5 large TIFF images and I want to
store the description of each image as meta data on the zip so I can
easily extract these descriptions to populate a drop down list).

For example:
Grand Canyon, Egypt at Night, SF Bridge,
would be the single text string I would I would like to store as meta
data.

I know Windows OS offers Summary info on files, but I need the meta
data to survive an ftp transfer up to a server and down to a clients
system and Windows file summary meta data does not.

So I'm looking for best approach recommendations, I'm trying to avoid
having to have the meta data in a separate xml file.
 
N

Nicholas Paldino [.NET/C# MVP]

JDeats,

Actually, it most likely is in the file. Vista (and XP, to some degree)
will recognize XMP packets in media files (which support it, meaning, AVI
files, TIFF, JPG, MP3 and others).

I know of one commercial .NET component for working with XMP data in
files:

http://www.chilkatsoft.com/xmp-dotnet.asp

You could use the XMP SDK from Adobe, but it is in unmanaged code, and
you would have to handle all the marshaling yourself (as well as create
wrappers for the class libraries, as I don't think those libraries export
functions).

When you tag files in Vista now, it actually writes XMP data to the file
(personally, I use Adobe Bridge, and XP and Vista recognizes them just
fine).
 
S

ssamuel

The ZIP file format doesn't store metadata other than its own.
The .NET framework 2.0 doesn't directly support ZIP files. If you're
using a third party ZIP library, see if they support metadata. If
you've rolled your own -- there's a way to do it using the .NET Gzip
libraries for deflation and writing your own file tables -- you should
be able to extend it however you like. If you still need it to be
compatible, you could maybe try a zero-byte file whose filename is the
metadata. Various other ZIP file readers may or may not display zero-
byte files.

TIFF files should also be able to store metadata.

s}
 
G

Guest

you could store the metadata in an ADS to the file. this file will be hidden
from users but tied to the original file so if the original file is deleted,
so will the ADS file.

hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top