example

command
v0.0.0-...-6eba221 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2017 License: MIT Imports: 4 Imported by: 0

README

Example to Create Downloadable Zip for HTTP Server

Example to Create the Zip for HTTP Server
func hello(w http.ResponseWriter, r *http.Request) {
    // Create zip file for HTTP server
    zf := createzip.NewForHTTP(w, "new.zip")
    // Add file into zip file. 1st param is the real file path, 2nd param is the file name in the zip file.
    // If file name in the zip file is empty, it will put the file in the root dir of the zip.
    zf.AddFile("./README.md", "")
    zf.AddFile("./main.go", "example/main.go")
    zf.Close()
}
Run Example

sudo ./example

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL