My requirement is to create a .zip file containing some files, but only if the resulting .zip file does not exceed a certain size limit.
Is there a way to determine the size of a .zip file other than by creating the file and then reading its size attribute? Is there a way to tell how big a .zip file will be before it’s actually created?
Imported from legacy forums. Posted by AlphaGuys (had 2412 views)
With our component, or any component for that matter, you cannot know the exact size of the resulting archive before actually creating the archive.
As a workaround, in this case, if you are always creating .zip file with the same types of file in it, you could estimate the compressed size. For example, (these numbers are all fictitious) if, with a normal compression level, the .txt files are reduced by 2.5 times, you can “estimate” that your next .txt file might be reduce by 2.5 times.
Imported from legacy forums. Posted by CharlesB (had 3123 views)