

The zipped files do not necessarily need to have exactly 20MB.

they need to be split into 20MB volumes, as other answers suggested ( winzip, 7-zip), and the resulting files cannot be used independently (breaking this 1 st assumption).they are not to be considered, and therefore must be separated.Since the OP requires that each zip file should be able to extract all its contents independently, files that surpass 20 MB after zipping must be handled in one of the following ways:.I figured out that this could be done manually as well, if the following assumptions are taken (this is not a pure technical problem–it is more of an organizational problem than technical): With that information, it would then be possible to decide which files should be grouped together by any of the standard approaches to the Knapsack Problem and create the actual zip files.Īssuming you have a scripting language available to you and you know how to use it, I would expect this approach to be fairly straightforward to automate doing it manually would be quite tedious if you have more than a handful of files to deal with.ĭave seemed to provide the closest programmable solution to what OP requested. If I were presented with this problem, I suppose I would start out by compressing each file individually to a temporary location (or in memory, without writing them to disk), just so that I could get an approximate compressed size for each.


The trivial solution, of course, would be to simply zip each file independently, but that fails to reduce the file count any, so I suspect it would not be a satisfactory solution. Aspose.Total Product Solution Aspose.Words Product Solution Aspose.PDF Product Solution Aspose.Cells Product Solution Aspose.Email Product Solution Aspose.Slides Product Solution Aspose.Imaging Product Solution Aspose.BarCode Product Solution Aspose.Diagram Product Solution Aspose.Tasks Product Solution Aspose.OCR Product Solution Aspose.Note Product Solution Aspose.CAD Product Solution Aspose.3D Product Solution Aspose.HTML Product Solution Aspose.GIS Product Solution Aspose.ZIP Product Solution Aspose.Page Product Solution Aspose.PSD Product Solution Aspose.OMR Product Solution Aspose.SVG Product Solution Aspose.Finance Product Solution Aspose.Font Product Solution Aspose.TeX Product Solution Aspose.PUB Product Solution Aspose.Drawing Product Solution Aspose.Audio Product Solution Aspose.Video Product Solution Aspose.What you're proposing is essentially a variation of the Knapsack Problem, with the added twist that, due to file compression, you don't start off knowing how much of your 20MB "knapsack" each item will occupy.
