Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Limit size of .zip file

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19849 |

    I’m new to Xceed Zip .NET, so be gentle.

    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?

    Thanks,

    Imported from legacy forums. Posted by AlphaGuys (had 2412 views)

    Xceed Support
    Member
    Post count: 5658

    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)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.