ZIPWriter

#40100
Posted: 01/10/2018 08:41:43
by Eduardo Helminsky (Standard support level)
Joined: 08/20/2010
Posts: 126

Hi

I am trying to add a file to an already existent ZIP file and it does not work. I have already tried the sample and everything appears to be right but nothing is happened.

Code
var ZIP: TElZipWriter;
    X: TElZipArchiveDirectoryEntry;
begin
     ZIP := TElZipWriter.Create(nil);
     try
        ZIP.Open(cZip,False);
        X := ZIP.Directory;
        ZIP.Add(X,cFile);
        ZIP.Close;
     finally
        FreeAndNil(ZIP);
     end;


Is there anything wrong with my code ?
#40102
Posted: 01/10/2018 12:43:51
by Vsevolod Ievgiienko (Team)

Thank you for contacting us.

You should call TElZipWriter.Compress() before TElZipWriter.Close().
#40104
Posted: 01/11/2018 01:43:15
by Eduardo Helminsky (Standard support level)
Joined: 08/20/2010
Posts: 126

Thank you very much.

Now it is working like expected.

Reply

Statistics

Topic viewed 408 times

none





Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!