diff --git a/handlers.go b/handlers.go index 2eb0033..1f057aa 100644 --- a/handlers.go +++ b/handlers.go @@ -197,7 +197,6 @@ func SaveBlob(c *Context) http.HandlerFunc { } if dir == "data" { - os.MkdirAll(filepath.Join(c.path, dir, name[:2]), 0700) name = filepath.Join(name[:2], name) } path := filepath.Join(c.path, dir, name) diff --git a/server.go b/server.go index b26eaf6..b5dc91b 100644 --- a/server.go +++ b/server.go @@ -2,6 +2,7 @@ package main import ( "flag" + "fmt" "log" "net/http" "os" @@ -29,6 +30,9 @@ func main() { for _, d := range dirs { os.MkdirAll(filepath.Join(*path, d), 0700) } + for i := 0; i < 256; i++ { + os.MkdirAll(filepath.Join(*path, "data", fmt.Sprintf("%02x", i)), 0700) + } // Define the routes. context := &Context{*path}