I am trying to use the ZipFiles() utility method and its producing an empty zip file. I am using Sitecore 6.5. There are no error, permissions or otherwise.
Any thoughts? Here is the code.
public void CreateZipFile(string zipfileName, List<string> files)
{
var zipfile = string.Format("{0}/{1}/{2}", TempFolder.Folder, "myfolder", zipfileName) ;
var fileArray = files.ToArray();
var x = FileUtil.ZipFiles(zipfile, fileArray);
}
EDIT: I am passing the files like this
var files = new List<string> { FileUtil.MapPath("/temp/sample.xlf") };
fileslist do you pass the absolute path of the file (e.g.c:\inetpub\readme.text) or just relative to the web app root? - Marek MusielakFileUtil.ZipFiles("/test.zip", new []{"/web.config", "/otherfile.txt"})and the file will be created in the root of your web app. - Marek Musielak