hi, i am using this code to add multiple files and folders in a zip file. the files are added properly but upon adding folders, i get return value 526 which is the error code for a warning. and the folders are not added to the zip file.
try
try
xZip := TXceedZip.Create(nil);
for I := 0 to totalFiles - 1 do
begin
if Length(strArray[I]) > 0 then
begin
if itIsDirectory(strArray[I]) then
xZip.AddFilesToProcess(strArray [I] + '\')
else
xZip.AddFilesToProcess(strArray [I]);
end;
end;
with xZip do begin
License(OUR_LICENSE_KEY);
ZipFilename := dstPath;
PreservePaths := false;//savePath;
CompressionLevel := 1;
ProcessSubfolders := false;
Result := Zip;
end;
if Result <> 0 then
//log the error code
finally
xZip.Free;
end;
except
on Error: Exception do
//log the error message
end;
the value of xZip.FilesToProcess before calling xZip.zip is like
'F:\crap\WallPapers\Airfield.jpg'#$D#$A'F:\crap\WallPapers\100 dollar bills.jpg'#$D#$A'F:\crap\one folder\'
before calling the Zip function.
(I am using delphi 2007)