Improve generateAndLinkZipFile function

  • Module should use a sub-directory inside of private:// instead of leaving the files in the top-level directory.
  • Create a File entity for the zip file so that implementations of hook_file_download can use the entity.
  • Mark the File entity temporary so that it will be deleted by the file module's garbage collection (file_cron)
  • Using a File entity improves security because only the creator of the File entity can download the file (I think).

Merge request reports

Loading