Suppose you are working with the ZIP files all the time. Let's call it your business/job routine or process. Someone uploads ZIP files everyday to the server and you have to find specific documents in them.
Normally, you would download the ZIP files and extract them or open them using any archiving tool (e.g. WinZip) and look for the right ZIP that contains the required file(s).
How about getting compressed files information without downloading them?
Suppose, you have 20+ different formatted files compressed in DailyFiles.ZIP.
This is how you can view the compressed files in your Web application (there's no need to download the ZIP):
Have a look at the code below:
string outputDirectory = @"D:/";
string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");
using (Viewer viewer = new Viewer(@"D:/DailyFiles.zip"))
{
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
viewer.View(options);
}
This document viewer API basically renders the source file into HTML. Later, this resultant HTML could be displayed in the browser or any other application (e.g. Desktop). In case of any issue for further details, you can raise your concerns here.
Top comments (0)