Announcement

Collapse
No announcement yet.

Are Multi-Part ZIP files handled by ZIP Plugin (zip.extract)?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Are Multi-Part ZIP files handled by ZIP Plugin (zip.extract)?

    I have a project which is downloading (using HTTP) around 40 ZIP files of about 100Mb each.

    The ZIP files are a multi-part archive.

    The "zip.extract" function does not seem to like the format of these files (created with 7-Zip).

    Should the "zip.extract" function be able to handle multi-part ZIP archives?

  • #2
    Meant to add...

    The 'zip.extract' function returns:

    Error 2622 ("The internal structure of the zip file is invalid.")

    Comment


    • #3
      Originally posted by rdtaylor View Post
      Should the "zip.extract" function be able to handle multi-part ZIP archives?
      As far as I know, the Zip plugin does not support multi-part Zip archives. You may need to bundle a command line tool to extract the content of these files.

      Ulrich

      Comment


      • #4
        Hi Ulrich,

        Thanks for the reply.

        That's rather a shame, as the main reason I'm using ZIP files now is because a single file I need to download is 2.3Gb in size...

        I guess I can make it a self-extractor, and run the extraction directly from my installer - would that be the best way to approach this?

        Comment


        • #5
          Just realised that multi-part ZIPs cannot be self-extractors...

          Comment


          • #6
            Hi Ulrich,

            I'm having quite a time trying to get this working!

            Here's what I'm trying to do:

            Have added the 7-zip command line tool as a "Primer File".

            Now I'm trying to construct a "File.Run" command string, but I seem to be having a hard time getting the formatting correct.

            "File.Run" needs to execute the following string:

            <%pathToExtractPrimerFile%>7za.exe x -y -p%strPassword% -o%strExtractPath% %strZIPFileNAme%

            The problem is, that both strExtractPath and strZIPFileName have spaces in them, meaning they need to be quoted.

            Here's my example code:

            DlgScrollingText.AppendLine(CTRL_SCROLLTEXT_BODY, "Please wait while downloaded ZIP files are extracted...", true, true);
            ZipResult = File.Run(SessionVar.Expand("%TempLaunchFolder%") .. "\\7za.exe x -y -pMYPASSWORD -o" .. SessionVar.Expand("%TempFolder%") .. "\"OUTPUTPATH\"" .. SessionVar.Expand("%TempFolder%") .. "\"\\ZIPs\\FIRSTZIPFILE.zip.001\"", "", SessionVar.Expand("%TempFolder%"), SW_SHOWNORMAL, true)
            if (ZipResult ~= 0) then
            Dialog.Message("ERROR!", "UnZip Returned error code : " .. ZipResult, MB_OK, MB_ICONINFORMATION);
            Application.Exit(800);
            else
            Dialog.Message("Success", "File unzipping successful!", MB_OK, MB_ICONINFORMATION);
            end
            The Sessionvar.Expand statements do not seem to be being expanded, and I feel like I'm going around in circles...

            Can you give me some tips on where I am going wrong, Ulrich?

            regards
            Robert

            Comment


            • #7
              Please download the attached sample project, build and run it as provided. This project will download five segments, each file 10 MB in size. At the end of the download, the file will be decompressed. The download folder and the target folder for the decompressed file can be set at the beginning of the demo.

              Ulrich
              Attached Files

              Comment


              • #8
                Many thanks, Ulrich...

                I had got it working just a short time ago (sometimes you can't see the forest for the trees!!).

                However, your example has some nicer error handling and functionality than mine etc. than mine, so I will learn some valuable lessons from your code.

                Again, thank you, and have a great weekend...

                Comment

                Working...
                X