def _add_file(self, filename, contents, tstamp):
        """
        Add a file to the zip archive.
        """
        if filename is None or contents in (None, 'null'):
            return
        fileinfo = zipfile.ZipInfo(filename, tstamp)
        fileinfo.external_attr = 0o666 << 16
        self._archive.writestr(fileinfo, contents, zipfile.ZIP_DEFLATED)

        Add a file to the zip archive.
        
portia_server/portia_api/utils/download.py