ihp-zip: Support for making ZIP archives with IHP

[ ihp, library, mit, web ] [ Propose Tags ] [ Report a vulnerability ]

Provides the renderZip / renderZipUnnamed controller helpers for streaming a Codec.Archive.Zip.Archive back to the browser as the response of an IHP action.


[Skip to Readme]

Modules

  • IHP
    • Zip
      • IHP.Zip.ControllerFunctions

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 0.1.1
Dependencies base (>=4.17 && <4.23), http-types (>=0.12 && <0.13), ihp (>=1.5 && <2), wai (>=3.2 && <3.3), zip-archive (>=0.4 && <0.5) [details]
License MIT
Copyright (c) digitally induced GmbH
Author digitally induced GmbH
Maintainer hello@digitallyinduced.com
Uploaded by MarcScholten at 2026-04-13T16:24:31Z
Revised Revision 1 made by MarcScholten at 2026-05-25T07:42:52Z
Category Web, IHP
Home page https://ihp.digitallyinduced.com/
Bug tracker https://github.com/digitallyinduced/ihp-zip/issues
Source repo head: git clone https://github.com/digitallyinduced/ihp-zip
Distributions
Downloads 16 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2026-04-13 [all 2 reports]

Readme for ihp-zip-0.1.1

[back to package description]

Support for making ZIP Archives with IHP

Install

  1. Add ihp-zip and zip-archive to the haskellDeps in your default.nix:
    let
        ...
        haskellEnv = import "${ihp}/NixSupport/default.nix" {
            ihp = ihp;
            haskellDeps = p: with p; [
                # ...
                ihp-zip
                zip-archive
            ];
        ...
    
  2. Run make -B .envrc
  3. Add IHP.Zip.ControllerFunctions to your Web.Controller.Prelude:
    module Web.Controller.Prelude
    ( module Web.Types
    , module Application.Helper.Controller
    , module IHP.ControllerPrelude
    , module Generated.Types
    , module IHP.Zip.ControllerFunctions -- <------- ADD THIS EXPORT
    )
    where
    
    import Web.Types
    import Application.Helper.Controller
    import IHP.ControllerPrelude
    import Generated.Types
    import IHP.Zip.ControllerFunctions -- <----- ADD THIS IMPORT
    

Usage

In your action use it like this:

module Web.Controller.Users where

import Web.Controller.Prelude

import qualified Codec.Archive.Zip as Zip

instance Controller UsersController where
    action ExportAction = do
        archive <- ["FileA", "FileB"]
                |> Zip.addFilesToArchive [] Zip.emptyArchive

        renderZip "Export.zip" archive