An archived file is a file stored inside an archive, such as a GZIP, RAR, or 7z file. The Archived File Name is the name of that stored file, as the archive records it. This name is separate from the file name of the archive itself.
For example, the gzip program turns a file called example.png into a file called example.png.gz. The archive gets the new name, but the Archived File Name inside it stays example.png.
In other contexts, "archived" means that files were moved out of daily use into long-term storage. This article covers the metadata field for files stored inside an archive file.
Which files carry it
In the metadata program ExifTool, the tag ArchivedFileName comes from GZIP, RAR, and 7z archives. For a GZIP file, ExifTool reads these tags for the first file in the archive only. For a RAR or 7z archive, it reads every file, but the exiftool command shows only the first name unless you add -a.
Comic book archives are ordinary archives with a different extension. A CBR file is a RAR archive, and a CB7 file is a 7z archive. The name of a page image can therefore appear in this field.
ZIP archives store the same kind of name, but ExifTool reports it as ZipFileName. ExifTool also reports this tag for some formats built on ZIP, such as DOCX documents. A CBZ comic is a ZIP archive too.
Where the value comes from
The archiving program writes the name when it adds a file to the archive. In a ZIP or RAR 5 archive, every stored file has its own header, which holds the name.
GNU gzip saves the original file name by default, unless you use the option -n. Data that did not come from a named file has no name at all. A flag bit in the GZIP header shows whether a name is present.
What the value looks like
The value is a plain file name with its extension, such as example.png. In ZIP and RAR 5 archives, the name can also include a folder path. A forward slash / separates the folder names.
A ZIP path never starts with a drive letter or a slash. A GZIP name never includes folders, because gzip removes them.
Each format also sets the characters that a name can use:
- GZIP: ISO 8859-1, also called Latin-1
- ZIP: the old IBM Code Page 437, or UTF-8 when a bit flag says so
- RAR 5: always UTF-8
Code Page 437 limits names to the characters of the original MS-DOS range. UTF-8 supports the full Unicode standard, so it can store letters from many more languages.
Why it matters
The field shows what is inside an archive before you unpack it. The archive itself can have any name, but this field gives the name and extension of the stored file.
For a GZIP file, the value keeps the original name even if someone renames the .gz file later. The gunzip command ignores the stored name by default, but the option -N restores it.
A .tar.gz file is a TAR archive compressed by gzip. If gzip compressed the TAR file as a separate, named file, the value names that TAR file. When the tar program compresses the archive in the same step, the value is often missing.
File names can reveal private details, such as a person's name or a project name. ZIP encryption usually protects only the file contents.
The names, sizes, and dates of the files stay readable unless the archive also uses the separate central directory encryption feature. In a RAR 5 archive with encrypted headers, the headers that hold the names are encrypted too.