ENH: Fix path joiner in zip func

This commit is contained in:
Matthew Ryan Dillon 2016-10-11 20:44:33 -07:00
parent da70d93cfe
commit 2500c267be

View file

@ -9,6 +9,7 @@ import (
"os"
"path/filepath"
"regexp"
"strings"
)
func rootHandler(w http.ResponseWriter, r *http.Request) {
@ -96,7 +97,8 @@ func Unzip(src, dest string) error {
}
}()
path := filepath.Join(dest, f.Name)
components := strings.Split(f.Name, "/")
path := filepath.Join(append([]string{dest}, components...)...)
if f.FileInfo().IsDir() {
os.MkdirAll(path, 0755)