using 4D v16, Mac:
I can successfully Zip a folder using the Zip plugin.
However ...

I'm building docx files, which consist of a zipped folder of xml files. I
need to create the Zip archive by adding just the actual files without
their enclosing folder. I believe the ZIP_Without_enclosing_folder option
in the Zip function should do the trick, but it doesn't seem to work.

Sample code:

$folder:=*Select folder*("Folder to zip:")

$dst2:=*GetDataExportsFolder* +Folder separator+"wordtest.docx"

*ZIP_CALLBACK_INIT*

$dst:=*GetDataExportsFolder* +Folder separator+"wordtest.zip"

$success:=*Zip* ($folder;$dst;"";ZIP_Without_enclosing_folder"ZIP_CALLBACK")
// contents must be added individually to the zip archive

*ZIP_CALLBACK_DEINIT*

*If* (*Test path name*($dst2)=Is a document)

*DELETE DOCUMENT*($dst2)

*End if*

*COPY DOCUMENT*($dst;$dst2)

​This appears to work, but if I unzip wordtest.zip, ​it creates a folder
named the same as the original folder ($folder), indicating that it HAS
included the enclosing folder.

What am I doing wrong?

Thanks!
Pat

-- 
*************************************************
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to