zip_save

This function saves the ZIP file that you created with zip_create to the given file path.

If the call is successful, a request ID is returned, and later the Async Save / Load event is triggered where this ID can be checked. In case of an error, a fatal error is thrown.

The async_load map in the Save / Load event will contain the following keys:

NOTE This functionality is not available for the HTML5 target platform.

 

Syntax:

zip_save(zip_object, path);

ArgumentTypeDescription
zip_objectZIP FileA ZIP file created with zip_create
pathStringThe file path that the ZIP will be saved as

 

Returns:

Real

 

Example:

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.