Packmatic.Conn (Packmatic v2.0.0)

View Source

Contains convenience functions which can be used to easily integrate a Zip stream with Plug-using applications such as Phoenix.

Summary

Functions

Convenience function which sends the stream to the conn. The content of the Stream will be sent with an appropriately configured Content-Disposition response header (as attachment), and the name provided will be encoded for maximum compatibility with browsers.

Functions

send_chunked(stream, conn, filename)

Convenience function which sends the stream to the conn. The content of the Stream will be sent with an appropriately configured Content-Disposition response header (as attachment), and the name provided will be encoded for maximum compatibility with browsers.

The encoding strategy follows RFC 2231 and RFC 5987 so as to allow reliable use of Unicode-based file names.

Examples

stream
|> Packmatic.Conn.send_chunked(conn, "download.zip")