I am working on a webapp that uses SCORM so that it can be incorporated into our clientโs learning management systems. This works by creating a zip file containing multiple files. Two files depend on the specific resource they want to include and the client itself. Therefore, I would like to generate these zip files automatically, upon request.
So, imagine that I have a "template" version of ZIP extracted to a directory:
/zipdir/fileA.html
/zipdir/fileB.xml
/zipdir/static-file.jpg
Suppose I use the Django template template in filesA and fileB. I know how to run a file through the template loader and display it, but how to add this file to a ZIP file?
Can I create a base zip file (which does not have fileA and fileB) and add two renderings to it? Otherwise, how would you clone zipdir to a temporary location and then transfer these two files before they are zipped?
source
share