This function creates a new ZIP file and returns its reference. This ZIP file is stored in memory, where you can add files to it using zip_add_file, and save it to disk using zip_save.
Files added to a ZIP file are always compressed at the maximum compression level.
The ZIP file is automatically garbage-collected when it's no longer referenced. As long as it is referenced, it will continue to exist in memory and files can be added to it at any time, even after zip_save is called on it. However you can't add files into the ZIP while it's in the middle of being saved to disk.
NOTE This functionality is not available for the HTML5 target platform.
zip_create();
var _zip = zip_create();
zip_add_file(_zip, "new.txt", "new.txt");
zip_add_file(_zip, "sounds/snd_attack_arc_01.wav", "snd_attack_arc_01.wav");
zip_save(_zip, "upload.zip");
This creates a new ZIP file, adds two files to it (with the second file in a subdirectory called sounds/) and then saves the ZIP to disk as upload.zip.