# How to add files in archieve without paths

 mli2805 Feb 16, 2013 at 3:48 PM Edited Feb 16, 2013 at 3:50 PM How to add files in archieve without paths? I have a folder c:\aa\bb\cc\dd\ee\ with 10 files and make archieve c:\aa\bb\cc\dd\ee\all.zip If I add files as  var filenames = Directory.GetFiles(directoryToZip); foreach (var filename in filenames) zip.AddFile(filename); zip.Save(zipFileToCreate);  in archieve I must step over all this folders  aa bb cc dd ee and only then I see my files! alijmoor Feb 17, 2013 at 7:51 AM Edited Feb 17, 2013 at 7:53 AM Hello This can be done very easily by passing String.Empty, or "" as the second parameter to the Zip.AddFile method. This will place all the files in the root of the ,zip file (without any directory information) - see the modified code snippet below  var filenames = Directory.GetFiles(directoryToZip); foreach (var filename in filenames) zip.AddFile(filename, String.Empty); zip.Save(zipFileToCreate); Be aware that if you use this method, and have files with the same name in different directories, it will cause an error as it will attempt to place the same file name more than once in the root of the .zip file. Hope this helps mli2805 Feb 17, 2013 at 8:42 AM Yes! This is what I want. Thanks!