A method for packing the multiple files and folders of an HTML Web page
into a single MHTML file. The packing process begins by determining
whether the user has write privileges to the current location. If not,
the user is prompted to save the MHTML file in an alternate location
(e.g., the desktop). If the user has write privileges to the current
location, the process opens the main HTML Web page and searches for
supporting resource files. In short, the supporting resource files are
identified by searching for known, common resource file references in the
main HTML source file. When the resource file references have been
identified, the process packages the main HTML document and all of the
supporting resource files into a single file in MHTML format. The
unpacking process opens the MHTML file and identifies the main HTML
document portion, as well as the portions of the MHTML file containing
the supporting resource files. Once all of the components have been
identified, the Web page's folder structure is determined by referring to
the content location field contained in each separate portion of the
MHTML file. The individual MHTML components are converted into files and
the main HTML file is stored. The resource files are stored in locations
relative to the main HTML file, as identified by the unpacked folder
structure.